RISC-V ROS Car
Yahboom RISC-V ROS Car is a multifunctional ROS car built on Meles, equipped with laser radar, gimbal camera, handle and other accessories. It is developed with ROS2 and supports SLAM mapping, automatic path planning and obstacle avoidance, gamepad remote control, APP remote control and other functions. It is a good helper for you to learn Meles and ROS.
Overview
The RISC-V ROS Car consists of the following parts:
- TOF LiDAR on top
- 2-DOF camera gimbal
- Milk-V Meles
- MicroROS Control Board
- Chassis 310 Encoder Gear Motor
- 7.4V Battery
- Gamepad and other accessories
Meles runs the openEuler system with ROS2, connects to the MicroROS control board through the serial port, and transmits sensor and control data such as radar, battery, accelerometer, etc. by subscribing to topics in ROS. You can find more information about openEuler and ROS in OERV. You can check Data Summary for information about the MicroROS control board.
The laser radar model installed on the car is Orbbec MS200, with a sampling frequency of 4500 times per second and a scanning frequency of 7~15Hz. For more information, you can refer to the user manual.
Quick Start
Robot assembly
For the assembly of the robot, please refer to Assembly Video and Assembly Steps。
Before Starting
During the operation of the robot, you may need to observe the status at all times to ensure that the robot is running normally. On the MicroROS control board, there is a blue LED that indicates the operating status of the control board and the battery power. The following are the introductions to the indicator status:
- The indicator light flashes twice every three seconds, indicating that the connection is normal.
- The indicator light flashes once per second (slow flash), indicating that the control board is in configuration mode.
- The indicator light flashes three times every three seconds, indicating that the control panel is currently in test mode.
- The indicator light flashes once every 100 milliseconds (fast flash) and the buzzer beeps, indicating that the battery voltage is low and the robot needs to be charged.
For more information about the MicroROS control board, please refer to Data Summary。
In some of the following steps, you may need to enter your username and password in Meles. The following are the default username and password.
- User Name:openeuler
- Password:123456
In addition, the ROS car will automatically establish a wireless AP after starting up to facilitate your connection.
- SSID:MicroROS_AP
- Password:12345678
First Boot of the Robot
Flip the switch on the MicroROS control board to power on the ROS robot. After powering on, please wait for Meles to start up, which takes about 2-3 minutes.
If you have an HDMI monitor plugged into your board, you will see the following three terminals automatically launched on the screen.
These three terminals run the connection agent, handle control, and map building tasks respectively. The use of these programs will be introduced to you in the following articles.
At this time, open the gamepad and press the R1 button to unlock the chassis.
After unlocking the chassis, press the X
, Y
, A
, and B
buttons to control the direction of the gimbal, move the left joystick forward and backward to control forward/backward, and move the right joystick left and right to control the car to turn left/right.
If you cannot use the handle to control the car, please refer to the MicroROS board firmware burning section to burn and configure the MicroROS control board.
Using VNC on the ROS Car
In most cases, it may not be convenient for you to connect the ROS car to a monitor. In this case, you can use VNC to remotely connect to the robot desktop to avoid the trouble of using physical peripherals.
First, you need to use SSH or connect a monitor and keyboard to open a terminal to execute commands.
The VNC used by the ROS car is tigervnc
, which is installed in the system by default. If you find that your system is not installed, you need to execute sudo yum install tigervnc-server
to install it.
Run the following command to set a password for VNC connection, enter the password twice to confirm, and enter n to disable view-only mode.
vncpasswd
Then add the user and number, execute the following command, and modify :2=openeuler
in the file, as shown in the figure below. When you have finished edit, press ctrl
+ O
to save, and ctrl
+ X
to exit.
sudo nano /etc/tigervnc/vncserver.users
Next, add a service for VNC and execute the following command. You may need to enter the password several times during the execution.
# Copy service files
sudo cp /usr/lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:2.service
# Reload systemd
systemctl daemon-reload
# Set the system to start automatically and start the service
systemctl enable vncserver@:2.service
systemctl start vncserver@:2.service
Finally, execute the following command to verify whether VNC is started successfully.
systemctl status vncserver@:2.service
Under normal circumstances, the terminal output is as shown below.
After successful startup, you can use any VNC client to connect to the robot.
The default service port of Tigervnc is 5902
, and the default IP address of the ROS car is 10.42.0.1
.
When connecting to VNC, please use the correct IP address and port number.
Disable auto-start script
When the robot is turned on, the connection agent, gamepad control, and map building tasks are started by default. If you want to run other tasks manually, you may need to turn off the automatic startup of these software to prevent conflicts between programs.
Using desktop environment
If you use a keyboard, mouse, and monitor, or VNC to operate the ROS car, you can directly use the desktop environment to disable the auto-start script.
Find it in the upper left corner of the desktop Application
-Settings
-Sessions and Startup
.
In the opened page, find the Application Autostart
tab, where myprogram
is the ROS-related startup item. Uncheck the checkbox in front of it to cancel the autostart.
Use command
If you use SSH to operate the ROS car, or it is inconvenient for you to enter the desktop environment, you can use commands to disabled the auto-start script.
First, execute the following command to enter the directory where the startup items are stored and list the files in it.
cd .config/autostart/
ls
Under normal circumstances, you can see the following three files.
Take handle.desktop
as an example. If you need to disable this startup item, you need to execute
sudo nano ./handle.desktop
Then add comments at the beginning of lines 5 and 6 of the file, and press ctrl
+ O
to save, and ctrl
+ X
to exit.
Gamepad and keyboard control
If you need to manually enable gamepad or keyboard control, first you need to open the agent program and connect to the agent, execute the following command
sh ~/start_agent.sh
If the program is stuck at the first two lines after you start the agent, press the reset button on the MicroROS controllor to connect to the agent.
Gamepad Control
Open two terminals and execute the following commands.
Terminal 1:
ros2 run joy joy_node
Terminal 2:
ros2 run yahboomcar_ctrl yahboom_joy
After the above code runs successfully, press the R1 key to unlock the chassis.
After unlocking the chassis, press the X
, Y
, A
, and B
buttons to control the direction of the gimbal, move the left joystick forward and backward to control forward/backward, move the right joystick left and right to control the car to turn left/right, and press the Start button to control the buzzer beep.