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

How can I change the robot's max velocity programmatically?

asked 2012-08-24 16:55:10 -0500

updated 2014-01-28 17:13:27 -0500

ngrennan gravatar image

Hello,

I would like to change the max_vel_x parameter programmatically, at runtime to increase or decrease the speed of the robot, based on environmental conditions. Is this possible with the TrajectoryPlannerROS base local planner?

I am using the SimpleActionClient API to send goal locations to the robot. For some of these goals, I would like to be able to also decrease the maximum speed.

Thanks in advance, Charles

edit retag flag offensive close merge delete

Comments

2

After some more investigation, I learned that I can use the dynamic_reconfigure tool, and that it has a command line. While not an elegant solution, I could execute a system command from my code, i.e. rosrun dynamic_reconfigure dynparam set /robot_0/move_base/TrajectoryPlannerROS max_vel_x 0.1

ceverett gravatar image ceverett  ( 2012-08-24 17:23:28 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2012-08-29 06:26:19 -0500

Thomas D gravatar image

I asked something similar about a C++ API for a dynamic reconfigure client here and Pablo gave a good answer for how to get around the lack of such an API. He suggested using the service

/my_node/set_parameters

with topics

/my_node/parameter_descriptions-
/my_node/parameter_updates-

That service and those topics are provided by the dynamic reconfigure server.

edit flag offensive delete link more
2

answered 2013-05-03 16:52:41 -0500

jorge gravatar image

I make a system call to the dynamic_reconfigure server:

system("rosrun dynamic_reconfigure dynparam set <node_name> \"{ param1: value1, param2: value2, ... }\"");
edit flag offensive delete link more
1

answered 2012-08-29 05:47:15 -0500

You can use dynamic_reconfigure python API. See http://www.ros.org/wiki/hokuyo_node/Tutorials/UsingDynparamToChangeHokuyoLaserParameters point 1.4

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-24 16:55:10 -0500

Seen: 2,168 times

Last updated: May 03 '13