Control your robot with a joystick in ROS

In other tutorials, I showed how to get access to the joystick and how to code with that. In this tutorial, I’m  gonna show you how to do that without writing any line of code.

First, install the required packages:

Now call the following

 

This will publish the topic “/joy_node” which is type of “sensor_msgs/Joy

Now you need to create your favorite message from that, for instance, if you want to move your robot you need to create “Twist” and publish that over /cmd_vel. To do that, create a yaml file and call it “joystick_param.yaml”, then put the following in the file and save it:

 

 

 

 

Now load it to ROS param:

Then you can call joy_teleop.py, so it will check the values that you set into teleop and publish 

/chatter and /cmd_vel

Alternatively, you can just call the following which will do lines above at once:

 

read more:

joy, joy_teleop, teleop_twist_joy, teleop_example

2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
1 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
adminWone Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Wone
Guest
Wone

I copied the joystick_param.yaml file, now where do I put it? When I type in
rosparam load joystick_param.yaml, I get this error:ERROR: file [joystick_param.yaml] does not exist