Remote control setup on ROS2
Connect a remote controller to Ubuntu for manual control
Last updated
Connect a remote controller to Ubuntu for manual control
Last updated
To manually control a robot, we can use either the FlySky FS-i6 or the Logitech F310 game controller.
In this tutorial, we will explain how to connect these RC devices to Ubuntu 22.04 desktop machine to control a simulated robot in Gazebo. Then, we will explain how to use the FlySky FS-i6 remote controller in NAVQ.
To follow this tutorial, you need:
Logitech F310 game controller: this controller can be connected only via USB (more details are here)
FlySky FS-i6 controller: this controller can be connected via USB or via radio communication (in this case we need to connect the transmitter, see below for more details)
Ubuntu desktop 22.04
Navq board
With kernel version above 5.4, the driver is already included. For versions below, follow this guide to manually install the driver:
Install the joystick tester:
Launch jstest-gtk GUI tool: you should see your controller show up as "FS-iA6B iBus RC receiver" in the list of detected devices.
When you move the control sticks, the bar graphs should change accordingly.
Now your RC transmitter is connected to Ubuntu. You can use existing simulators like FlightGear, but here, we will focus on our ROS2 simulation.
Let's start by configuring the RC transmitters.
Some buttons should be at specific position to be able to control the simulated robot.
Make sure that the button in the back is pointed to X and not to D.
The picture below shows the functionality of each button we need in simulation.
For Gazebo simulation, you need first to configure the SWx buttons as follows:
SWA down
SWB middle
SWC middle
SWD up
The arming button is in the back left. The right back button is for disarming.
Run the Gazebo simulation:
In another terminal, run the node “joy”:
You must see the message below:
To see the topic messages, run the following command in another terminal:
To control your simulated robot with the RC transmitter you need to arm the vehicle using the corresponding button. Also, make sure that the mode is “manual”. You can see arming and mode status in the Cerebri terminal.
The Logitech F310 game controller and FlySky FS-iA6 remote controllers can also be used with NavQPlus.
To connect the Logitech F310 game controller to NavQPlus board, use the USB Hub with USB-C connector similar to the photo below.
The FlySky FS-iA6 Remote controller can be connected to NAVQ since the Ubuntu release 22.04.3
Connect the FSia6b receiver to NavQPlus using UART connection (you need to make new cable as the one in the photo below).
Connect to NavQPlus using ssh and tap the following command:
You can add & at the end of this command to run it on background and avoid opening a new terminal for the next command.
Connect to your NavQPlus through ssh, then run the joy node:
Open a new ssh connection, and run the following command:
You can now change the light intensity and control the motors using your remote controller.