ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'm not sure if this is the correct way to solve it, or this should be the 'answer' but I managed to get my robot footprint to change dynamically via C++ by using dynamic_reconfigure dynparam, like this:

 std::string footprint_str = "[[0.83,-0.28],[0.356,-0.28],[0.166,-0.3],[-0.03,-0.3],[-0.03,0.3],[0.166,0.3],[0.356,0.28],[0.83,0.28]]";
 std::string footprint_node = "rosrun dynamic_reconfigure dynparam set /move_base/local_costmap footprint ";
 system((footprint_node + footprint_str).c_str());

This came from here UsingDynparamToChangeHokuyoLaserParameters (at the bottom of the page)

So when you change footprint_str (which I'm doing manually at the moment via a lookup table of sorts) the actual robot footprint changes to match it straightaway.

I would like to use something like this example but this code doesn't look complete and I don't know enough about point32 arrays, tf2::doTransform and then how to get this back to a string.

Long story short, it works good enough for me. Although now when I kill the node it says escalating to SIGTERM, probably due to the 'system' call, it'll work until a proper solution comes around. anyone??? ;)