Ask Your Question
0

argument remapping: how to find the argument name

asked 2014-02-10 19:29:42 -0500

updated 2014-02-10 20:12:09 -0500

Following the UnderstandingServicesParams Tutorial
I create another turtle using

$ rosservice type spawn| rossrv show

I can control the turtle2 by publish a topic to it directly.

$ rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

but I want to use

$ rosrun turtlesim turtle_teleop_key

then I can control it using my keyboard.

So I think I should do a argument remapping. There should be a argument control which turtle I want to control.(just call it _id instead) so I can run

$ rosrun turtlesim turtle_teleop_key _id:=turtle2

so I'm wondering how to find the argument's name.(i.e. what is the real name of "_id")

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-02-10 19:43:44 -0500

ahendrix gravatar image

updated 2014-02-10 20:32:37 -0500

I'm not quite sure what the topics involved here are, but you should be able to use topic remapping to do what you're talking about, once you figure out which topic you need to remap.

I would start by looking at the topics that the turtle teleop node is publishing by running it, and running rosnode info turtle_teleop_key in another terminal. You should be able to find the relevant output topic; it will have type geometry_msgs/Twist. From there, simply run the turtle_teleop_key node and remap that topic your desired output topic: /turtle1/cmd_vel

If the current output topic is /turlte1/cmd_vel and the desired output topic is /turtle2/cmd_vel, your remapping argument would be:

rosrun turtlesim turtle_teleop_key /turtle1/cmd_vel:=/turtle2/cmd_vel
edit flag offensive delete link more

Comments

Thanks! /turtle1/cmd_vel:=/turtle2/cmd_vel is amazing!

lanyusea gravatar imagelanyusea ( 2014-02-10 20:41:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-02-10 19:29:42 -0500

Seen: 588 times

Last updated: Feb 10 '14