ros-teleop/teleop_twist_keyboard

Problems with speed_limit and turn_limit

Opened this issue · 3 comments

I tried to set the variables speed_limit and turn_limit with a .yaml file and when I run the launch file, the following appear as parameters:

  • /teleop_twist_keyboard/speed_limit: 0.5
  • /teleop_twist_keyboard/turn_limit: 1.0

But even so, when I increase the speed, it exceeds the limits indicated, how could I solve the problem?

.yaml file:

speed_limit: 0.50
turn_limit: 1.0

launch file:

<node pkg="teleop_twist_keyboard" name="teleop_twist_keyboard" type="teleop_twist_keyboard.py" output="screen">
  <remap from="/cmd_vel" to="/turtle1/cmd_vel"/>
  <rosparam command="load" file="$(arg config_filepath)"/>
</node>

That appears correct at first glance.

You can confirm that roslaunch is setting the correct parameters by running rosparam list . Please run this after starting your launch file, and paste the output here.

I got this:

/teleop_twist_keyboard/speed_limit
/teleop_twist_keyboard/turn_limit

Hi @ECisneros20,

as you can see in teleop_twist_keyboard.py both params have tilde sign ("~") at the beginning. It means they're private parameters.

    speed_limit = rospy.get_param("~speed_limit", 1000)
    turn_limit = rospy.get_param("~turn_limit", 1000)

If you want to manipulate private params, you have to use node name as a prefix, so your YAML file should look like this:

/teleop_twist_keyboard:
 speed_limit: 0.5
 turn_limit: 1.0