Remote control setup on ROS2

Connect a remote controller to Ubuntu for manual control

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.

Requirements

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

Ubuntu desktop setup

Software setup

  • 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:

sudo apt install jstest-gtk –y
  • 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.

RC configuration

Some buttons should be at specific position to be able to control the simulated robot.

Logitech F310 buttons’ configuration

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.

FlySky FS-i6 buttons' configuration

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.

Running a simulation

  • Run the Gazebo simulation:

ros2 launch mrbuggy3_gz_bringup gz_nav2.launch.py
  • In another terminal, run the node “joy”:

ros2 run joy joy_node
  • You must see the message below:

  • To see the topic messages, run the following command in another terminal:

ros2 topic echo /joy
  • 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.

Using Logitech F310 game controller

To connect the Logitech F310 game controller to NavQPlus board, use the USB Hub with USB-C connector similar to the photo below.

Using FlySky FS-iA6

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:

sudo inputattach --fsia6b /dev/ttymxc2

You can add & at the end of this command to run it on background and avoid opening a new terminal for the next command.

Use RC with ROS2

Connect to your NavQPlus through ssh, then run the joy node:

ros2 run joy joy_node

Open a new ssh connection, and run the following command:

ros2 launch ros2_orchestrator orchestrate.launch.py 

You can now change the light intensity and control the motors using your remote controller.

Last updated