Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with speed_limit and turn_limit #38

Open
ECisneros20 opened this issue Aug 23, 2023 · 3 comments
Open

Problems with speed_limit and turn_limit #38

ECisneros20 opened this issue Aug 23, 2023 · 3 comments

Comments

@ECisneros20
Copy link

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>
@trainman419
Copy link
Contributor

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.

@ECisneros20
Copy link
Author

I got this:

/teleop_twist_keyboard/speed_limit
/teleop_twist_keyboard/turn_limit

@jkaniuka
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants