humanoid-path-planner / hpp_tutorial

Tutorial for humanoid path planner platform
BSD 2-Clause "Simplified" License
7 stars 12 forks source link

Extracting paths from solutions for further execution #43

Closed DrawZeroPoint closed 2 years ago

DrawZeroPoint commented 2 years ago

Dear HPP developers,

Now I would like to execute the planned paths derived from the problem solver on a robot controlled via ROS, but it is not clear how to get these paths using the Python API. To tell from the name, the function getWaypoints(PathID) seems to do the work but only returns sparse keypoints. I am aware that using CPP one can do like this:

Configuration_t q;
  for (value_type t=0; t<L; t+=.01) {
    q = path->eval (t, success);
    assert (success);
    std::cout << "path.append (" << displayConfig (q) << ")" << std::endl;
  }
  q = path->eval (L, success);

where q is the configuration at time step t that could be easily converted to robot base commands and joint configurations. And one can freely decide the time interval to control the trajectory length. So what could be the equivalent way for doing this using Python, or the solution should be handled in a different way?

florent-lamiraux commented 2 years ago

Method pathLength(pathID) gives you the length of the interval of definition of the path. Method configAtParam(pathId, t) where t lies between 0 and the value returned by the above method gives you the configuration at parameter t.