For mapping, I found it annoying to drive the GoPiGo3 around with the keyboard teleop - you always had to be in that shell window to drive the robot. I saw that the teleop_tools package that the book Hands on ROS had me download actually has a joy_teleop folder. But when I looked at it and the accompanying config file, it looked like overkill (and I didn’t find any real documentation on the config yaml file with my initial pass on Google).
A couple of years ago when I was first learning ROS I had actually written a very basic joystick node. I dug that code out and cleaned it up a little. It works for basic back-forth and turns. Doesn’t currently do moving turns - I’m not sure why. I’ll troubleshoot that and update the code if I find a solution.
Notes:
You do have to install the Joy node on your desktop/PC, since I’m not using the teleop_tools that
sudo apt update
sudo apt install ros-melodic-joy
(I’m using ROS Melodic - substitute your version if you’re running something else)
I was caught by the issue ROS had with their GPG keys - see their blog post for the fix:
https://discourse.ros.org/t/ros-gpg-key-expiration-incident/20669
The script (gpg3_joy.py) and launch file (gpg3_joy.launch) are both in my github repository:
https://github.com/KFW/gpg3_pc
I’m using a Microsoft Xbox 360 wired controller. Other controllers will work, but you may have to change the values for the axes. Helpful resources:
http://wiki.ros.org/joy
http://wiki.ros.org/joy/Tutorials/ConfiguringALinuxJoystick
/K