Skip to content

3. Real Robot Instruction

Kartik Soni edited this page Sep 23, 2024 · 2 revisions

Important

Warning: When the robot is first powered on, it starts in demo mode and can be manually controlled using the RC. However, without a WiFi connection, critical features like mission planning, SSH, RViz visualization, and development mode are unavailable. To unlock full functionality, including remote access, the initial WiFi setup must be completed.

3.1 Initial Wifi Setup

Follow the steps below to connect the robot to your desired Wifi network

1. Create a mobile hotspot

Initiate a hotspot from your smartphone/laptop with the credentials

  • Hotspot Name: admin
  • Hotspot Password: adminadmin

2. Start the robot

Power on the robot and wait until it connects to your hotspot network

On powering on: When connected to hotspot:
Step1 Step2

3. SSH into the robot

  • Connect your laptop/remote device to the same hotspot

  • Open a new terminal, and enter the SSH credentials
# Method 1-ssh using user name 
ssh [email protected]  
pwd: "rbl@2020"

#Method 2 -ssh using ip address 
ssh [email protected]  
pwd: "rbl@2020"

Tip

IP can be seen on the display of robot once connected with WiFi

Method1 Method2
Step1 Step1

4. Connect to Wifi

  • Enter the following command on the ssh terminal to check available networks
sudo nmcli dev wifi list --rescan yes

Step1

  • Connect to your wifi network
sudo nmcli device wifi connect "your-wifi-name" password "your-wifi-password"

Step1

Important

This will close the ssh pipeline and no response will be recieved over it further. Wait for about 30 seconds for robot to be connected to your wifi, once connected it will show the wifi name along with the IP address on the robot display.

4. SSH using your Wifi

  • Now the robot is connected to your Wifi network! You can now shutdown your mobile hotspot, connect your remove device to the same wifi and access the robot using SSH:

Step1

3.2 Launch Sequence

Switching mode in robot

Modes of robot.

There are two modes of robot

1. Demo Mode - ROS2 nodes are automatically launched during the robot's startup/boot process.

Note

By default, the robot is configured to start automatically in Demo Mode, running ROS without requiring a Wi-Fi network. To start the robot in Demo Mode (i.e., to automatically launch the desired ROS processes on boot), use the following command:

# For going into demo mode
cd ros2_ws/src/diadem
./demo.sh

2. Development Mode - No ROS2 nodes are launched during startup.

Note

To switch to Development Mode, which will prevent any ROS processes from starting automatically, allowing you to test your launch files, SSH into the robot and execute the necessary commands to disable automatic startup.

# For going into Development mode
cd ros2_ws/src/diadem
./development.sh

To launch only sensors and actuators without navigation and odometry:

ros2 launch diadem_firmware bringup.launch.py

By default realsense launch is set to False, launch the script with realsense:=True Argument to get the realsense up.

3.3 RC Control Mode

RC Control is operated by default on bootup. Turn on the Radiolink controller and set its mode to RC mode to start controlling the robot using RC.

RC control

Motor Control Modes

Criteria Direct Control Quick Adaptive Control Smooth Adaptive Control
RC and CMD Control
Fast Reaction Time Fastest Moderate Slowest
Closed Loop System False True True
Inertial Jerks Too Jerky Moderate Jerk Least Jerky

Robot Control Modes

Control Method Description WiFi Requirement Compatibility with PID Modes
RF Control Works directly with Radiolink RC controller without the need for any WiFi network. Not Required Direct Control
Quick Adaptive Control
Smooth Adaptive Control
ROS-based Teleop Control Subscribes to cmd_vel topic to actuate the vehicle. Requires WiFi network to work. Required Direct Control
Quick Adaptive Control
Smooth Adaptive Control
Pixhawk-based Control Uses Pixhawk to gain missions and converts the data to cmd_vel, which is accessible to ROS. Required Direct Control
Quick Adaptive Control

Custom PID Mode ⚠️

[!WARNUNG]🚫This mode is not recommended as the PID values are tuned by us. If you choose to use custom values, ensure that the robot is kept above ground.🚫

To add custom PID values and save them, use the following commands:

  1. Add Custom PID Values:

    ros2 topic pub -1 /pid/constants std_msgs/msg/Float32MultiArray "{data: [1.1, 2.2, 3.3]}"
  2. Save the Custom PID Values:

    ros2 topic pub -1 /pid/custom/save std_msgs/msg/Float32MultiArray "{data: [1.1, 2.2, 3.3]}"

The custom PID setup button is disabled by default and can only be accessed upon enabling it purposefully.

ros2 topic pub -1 /pid/custom/enable std_msgs/Bool "data: true"

When enabled, you can press the button shown above to switch to your custom PID mode with your custom PID values.

3.4 ROS-based Teleoperation Mode

ROS communication works on the WiFi Network. Make sure to arrange the WiFi network before starting the robot. Once connected to the network, SSH into the PC and launch:

ros2 launch diadem_firmware bringup.launch

IMPORTANT: This launch file is initiated by default on bootup of the robot. If the startup service is kept activated, you do not need to manually launch the files.

Now you can access the topics on the robot. Teleoperate the robot using teleop_twist_keyboard:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

3.5 ROS-based Pixhawk Control Mode

We be using Mavros package for interfacing with Pixhawk. Following are the steps to setup MAVROS and QGC (Q Ground Control which is mission planning application for any MAVLink enabled AGV)

Check your robot's connection via Pixhawk. It should be connected as shown below in USB Ports Configuration.

Method 1: Using QGroundControl

Important

The robot can be controlled directly via QGroundControl. Follow the steps below to connect the robot via QGC:

1. Install QGroundControl

Download the app from here (Compatible with Windows, macOS, Ubuntu, and Android)

2. Navigate to Application Settings > Comm Links > Add

3. Generate a new UDP Connection

4. Provide IP Addresses

Important

Enter the IP address of the robot. How to obtain IP?

5. Establish a connection

Important

There are chances when it is unable to establish a connection the very first time. In that scenario, delete the connection and follow the steps again.

Once connected, you will be able to see the robot's status and coordinates on the QGC page. Now you can control the vehicle and send missions through QGC.

Method 2: Using ROS Scripts

We have provided the API Script along with the package to enable the GPS navigation using ROS scripts

Navigate to diadem_firmware/scripts/waypoint_navigation.py to get access to the API

Link to Documentation

Important

To enable Obstacle avoidance in GPS navigation using Realsense d435i, follow the instructions provided here

3.6 USB Ports Configuration

IMPORTANT: Connect the USB ports as per the following diagram:

USB Port Connections USB Port Connections

3.7 Get IP Address of Robot

To find the IP address of the robot, run the following command on the robot's PC:

hostname -I

This will display the IP address of the robot. Use this IP address to SSH into the robot or connect it to your ROS network.


Visualizing in remote PC

ROS domain id for robot is set to 169. So to visualize robot ros topics in remote PC we need to enter below command in terminal of remote pc everytime we open a new terminal.

export ROS_DOMAIN_ID=169