mini_pupper_trajopt icon indicating copy to clipboard operation
mini_pupper_trajopt copied to clipboard

step_length is float while in robotoc, step_length is Vector3d

Open qZhang88 opened this issue 3 years ago • 0 comments

Data type mismatch here

in pacing code, as also trotting and others

class PacingOCPSolverFactory:
    def __init__(self, path_to_urdf=config.PATH_TO_URDF):
        self.path_to_urdf = path_to_urdf 
        self.step_length = 0.02
        self.step_height = 0.03
        # ....

    def create_ocp_solver(self):
       # ....
        LF_foot_ref = robotoc.PeriodicFootTrackRef(x3d_LF, self.step_length, self.step_height, 
                                                   LF_t0, self.swing_time, 
                                                   self.swing_time+2*self.support_time, False)

While in robotoc/bindings/python/robotoc/cost/periodic_foot_track_ref.cpp

PYBIND11_MODULE(periodic_foot_track_ref, m) {
  py::class_<PeriodicFootTrackRef, TimeVaryingTaskSpace3DRefBase,
             std::shared_ptr<PeriodicFootTrackRef>>(m, "PeriodicFootTrackRef")
    .def(py::init<const Eigen::Vector3d&, const Eigen::Vector3d&, const double, 
                  const double, const double, const double, const bool>(),
          py::arg("x3d0"), py::arg("step_length"), py::arg("step_height"),
          py::arg("t0"), py::arg("period_swing"), py::arg("period_stance"),
          py::arg("is_first_step_half"))
    .def("set_foot_track_ref", &PeriodicFootTrackRef::setFootTrackRef,
          py::arg("x3d0"), py::arg("step_length"), py::arg("step_height"),
          py::arg("t0"), py::arg("period_swing"), py::arg("period_stance"),
          py::arg("is_first_step_half")=false)
    .def("update_x3d_ref", &PeriodicFootTrackRef::update_x3d_ref,
          py::arg("grid_info"), py::arg("x3d_ref"))
    .def("is_active", &PeriodicFootTrackRef::isActive,
          py::arg("grid_info"));

examples/anymal/python/pace.py

line 16, step_length = np.array([0.25, 0, 0])

step_length need to be np array

qZhang88 avatar May 15 '22 03:05 qZhang88