yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MicroROS-Pi5📖
01. Introduction
  • 0.Unpacking and reviewing video
  • 1. ReadMe - learning route
  • 2. Introduction to lidar
  • 3. Introduction to microROS control board
  • 4. FAQ
  • 5. About charging
02. Assembly course
  • Assembly steps
03. Preparation
  • First Trial
  • 1. Write firmware
  • 2. MicroROS control board parameter configuration
  • 3. Connect to MicroROS agent
  • 4. Connect to WIFI in hotspot mode
04. Quick start control course
  • 1. Self start handle control
  • 2. Close the self-starting handle control process
  • 3. Quick start keyboard control
  • 4. Map navigation and APP control
05. Robot basic course
  • 1. Robot information release
  • 2. Robot keyboard control
  • 3. Robot handle control
  • 4. Robot state estimation
  • 5. Linear speed calibration
  • 6. Angular velocity calibration
  • 7. Robot URDF model
06. ROS+OpenCV course
  • 1. Getting started with Opencv CV
  • 2. Geometric transformation
  • 3. Image processing and drawing
  • 4. Open Source CV image beautification
  • 5. QR code creation and recognition
  • 6. AR vision
  • 7. ROS+Opencv application
07. Mediapipe course
  • 1. Hand detection
  • 2. Posture detection
  • 3. Overall detection
  • 4. Face detection
  • 5. Face recognition
  • 6. Face effects
  • 7. 3D object recognition
  • 8. Brush
  • 9. Finger control
  • 10 .Gesture recognition
08. Robot visual interaction
  • 1. Monocular camera calibration
  • 2. Color tracking
  • 3. Object recognition and tracking
  • 4. Face recognition tracking
  • 5. Autonomous driving line patrol
  • 6. QR code motion control
  • 7. Gesture control of basic movement of the car
  • 8. Control the car movement with your palm
  • 9. Gesture control car action group
  • 10. Palm control of the two-dimensional gimbal servo
09. Lidar course
  • 1. Lidar avoid
  • 2. Lidar following
  • 3. Lidar guard
  • 4. Lidar patrol
  • 5. Gmapping mapping
  • 6. Cartographer mapping
  • 7. Navigation2 navigation avoid
  • 8. ROS Robot APP mapping
  • 9. ROS Robot APP navigation
10. Multi-machine course
  • 1. Multi-machine handle control
  • 2. Multi-machine keyboard control
  • 3. Multi-machine navigation
11. Linux basic course
  • 1. Introduction to Linux system
  • 2. Ubuntu file system
  • 3. Ubuntu common commands
  • 4. Ubuntu common editors
  • 5. Ubuntu software operation commands
  • 6. Virtual machine installation
  • 7. SSH remote control
  • 8. VNC remote control
  • 9. Transfer files remotely
  • 10. Driver library and communication
  • 11. Static IP and hotspot mode
  • 12. Bind device ID
  • 13. Capacity expansion and resource allocation
  • 14. Update system software sources
  • 15. Set root user password
  • 16. sudo free password
  • 17. Connect to WiFi network
  • 18. View system version
  • 19. Customized service management
  • 20. Back up system image
12. RPi basic setting course
  • 1. Update and upgrade operating system
  • 2. Introduction to raspi-config tool
  • 3. config.txt file description
  • 4. Network Configuration
  • 5. remote access
  • 6. Transfer files remotely
  • 7. Set display resolution and rotation
  • 8. Set screen to sleep
  • 9. Get real-time temperature of Raspberry Pi
  • 10. Play audio and video
  • 11. Using USB camera
  • 12. Using MIPI camera
13. Docker course
  • 1. Overview and installation
  • 2. Common commands
  • 3. Docker images deeply understand and publish images
  • 4. Docker hardware interaction and data processing
  • 5. Enter the robot's docker container
14. ROS2 basic course
  • 1. Introduction to ROS2
  • 2. ROS2 install Humble
  • 3. ROS2 development environment
  • 4. ROS2 workspace
  • 5. ROS2 function package
  • 6. ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
15. microROS control board development environment
  • 1. Introduction to microROS control board
  • 2. Set up ESP32-IDF development environment
  • 3. ESP32-IDF configuration tool
  • 4. Install ESP32-microros components
  • 5. Install and start microROS agent
  • 6. Flash-tool burning firmware
16. ESP32 basic course
  • 1. Turn on the LED light
  • 2. Button function
  • 3. Drive the buzzer
  • 4. Serial communication
  • 5. Battery voltage detection
  • 6. Drive PWM servo
  • 7. Drive motor
  • 8. Read motor encoder data
  • 9. PID controls car speed
  • 10. Read IMU data
  • 11. Read radar data
  • 12. Flash access data
  • 13. Partition table and memory
  • 14. Bluetooth communication
  • 15. WiFi networking
  • 16. Robot kinematics analysis
  • 17.ROS-WiFi camera module
17. microROS basic course
  • 1. Publish topic
  • 2. Subscribe topic
  • 3. Multi-topic subscribe and publish
  • 4. Subscribe buzzer topics
  • 5. Subscribe PWM servo topics
  • 6. Subscribe speed control topics
  • 7. Release speed topic
  • 8. Release IMU data topic
  • 9. Publish lidar data topics
  • 10. Customized transmission method
Download
  • Mapping_APP(iOS_Android)
  • Source code
  • Hardware information
  • VM image file
  • RPi5 imgae file
  • Instruction Manual
  • 3D Model File
  • ROS2_Basic_VM
Download ZIP
FAQ
  • 1、1.USB camera abnormal termination

Welcome to MicroROS-Pi5 repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

3. Multi-machine navigation

Multi-machine navigation

Note: The ROS_DOMAIN_ID of the Raspberry Pi and the microROS control board need to be consistent. You can check [MicroROS Control Board Parameter Configuration] to set the microROS control board ROS_DOMAIN_ID. Check the tutorial [Connect MicroROS Agent] to determine whether the IDs are consistent.

1、Program function description

After the program is started, the target points of the two cars can be given in rviz. After receiving the instruction, the two cars calculate the path based on their own posture and move to their destinations.

2、Multi-machine function basic settings

Taking two robots as an example, it is recommended to use two robots equipped with Raspberry Pi and change the config_robot.py files respectively. Change the config_robot.py files respectively, and set robot.set_ros_namespace() to robot1 and robot2 respectively. And the ROS_DOMAIN_ID of the two cars needs to be set to the same. Then open the terminal in the /home/pi directory and enter sudo python3 config_robot.py to run this program (you need to change it back and re-run this program to run other programs except multi-car).

3、Start and connect to the agent

After the Raspberry Pi is successfully powered on, open the terminal and enter the following command to open the agent.

sh ~/start_agent_rpi5.sh

image-20240201170829209

Press the reset button on the microROS control board and wait for the car to connect to the agent. The connection is successful as shown in the figure below.

image-20240201170844137

4、Enter the car docker

Open another terminal and enter the following command to enter docker.

xxxxxxxxxx
sh ros2_humble.sh 

When the following interface appears, you have successfully entered docker. Now you can control the car through commands.

image-20240201170934845

Check the currently started node. Choose one of the two Raspberry Pis, open the terminal and enter the following command.

xxxxxxxxxx
ros2 node list

image-20240201170922801

As shown in the picture above, the nodes of both cars have been started.

5、Start rviz and load the map

5.1、Start rviz display

Choose one of the two Raspberry Pis at random, open the terminal and input, (it is recommended to use the matching virtual machine to open the map, opening it on the Raspberry Pi will be very laggy)

xxxxxxxxxx
ros2 launch yahboomcar_nav multi_nav_display_launch.py

image-20240201171208897

The functions of the signs in Figure 1-4 above are as follows:

【1】:robot1 calibrate initial pose

【2】:robot1 gives a target point

【3】:robot2 calibrate initial pose

【4】:robot2 given target point

4.2、Load map

Choose one of the two Raspberry Pis at random, open the terminal and input, (it is recommended to use the matching virtual machine to open the map, opening it on the Raspberry Pi will be very laggy)

xxxxxxxxxx
ros2 launch yahboomcar_multi map_server_launch.py

image-20240202161011814

Note: The map may fail to load here. If the map is not loaded, just ctrl c to close and rerun the program. The map path loaded here is as follows.

xxxxxxxxxx
/root/yahboomcar_ws/src/yahboomcar_multi/maps/yahboom_map.yaml

If you need to modify the default loading of other maps, copy the map's yaml file and pgm file to

/root/yahboomcar_ws/src/yahboomcar_multi/maps/ directory. Then modify the map_server_launch.py program, which is located in /root/yahboomcar_ws/src/yahboomcar_multi/launch. The modification places are as follows

image-20240201173014562

Replace the red box with the name of your own map, save and exit, and then enter the following instructions to compile.

xxxxxxxxxx
cd ~/yahboomcar_ws
colcon build

Then enter the following command to resource the environment variables.

xxxxxxxxxx
source ~/.bashrc

5、Start the car's underlying data processing program

Enter the following command in the Raspberry Pi terminal that starts robot1

xxxxxxxxxx
ros2 launch yahboomcar_multi yahboomcar_bringup_multi.launch.xml robot_name:=robot1

Enter the following command in the Raspberry Pi terminal that starts robot2

xxxxxxxxxx
ros2 launch yahboomcar_multi yahboomcar_bringup_multi.launch.xml robot_name:=robot2

yahboomcar_bringup_multi.launch.xml source code path,

xxxxxxxxxx
/root/yahboomcar_ws/src/yahboomcar_multi/launch/yahboomcar_bringup_multi.launch.xml
xxxxxxxxxx
<launch>
    <arg name="robot_name" default="robot1"/>
    <group>
        <push-ros-namespace namespace="$(var robot_name)"/>
        <!--imu_filter_node-->
        <node name="imu_filter" pkg="imu_filter_madgwick" exec="imu_filter_madgwick_node" output="screen">
            <param name="fixed_frame" value="$(var robot_name)/base_link"/>
            <param name="use_mag" value="false"/>
            <param name="publish_tf" value="false"/>
            <param name="world_frame" value="$(var robot_name)/enu"/>
            <param name="orientation_stddev" value="0.00"/>
            <remap from="imu/data_raw" to="imu"/>
            
        </node>
        <!--ekf_node-->
        <node name="ekf_filter_node" pkg="robot_localization" exec="ekf_node">
            <param name="odom_frame" value="$(var robot_name)/odom"/>
            <param name="base_link_frame" value="$(var robot_name)/base_footprint"/>
            <param name="world_frame" value="$(var robot_name)/odom"/>
            <param from="$(find-pkg-share yahboomcar_multi)/param/ekf_$(var robot_name).yaml"/>
            <remap from="odometry/filtered" to="odom"/>
            <remap from="/odom_raw" to="odom_raw"/>
        </node>
        <node pkg="tf2_ros" exec="static_transform_publisher" name="base_link_to_base_imu"
          args="-0.002999 -0.0030001 0.031701 0 0 0  $(var robot_name)/base_link $(var robot_name)/imu_frame " />
    
    <include file="$(find-pkg-share yahboomcar_description)/launch/description_multi_$(var robot_name).launch.py"/>
    
</launch>

A pair of tags are used here. The command space of all programs within this tag will be robot_name, which is the robot1 or robot2 we defined. Among them, there are also some parameter files or topic names that are automatically selected and loaded through this robot_name. You can view the content in the code for details.

6、Start the AMCL positioning program of the car

Enter the command in the Raspberry Pi terminal that starts robot1

xxxxxxxxxx
ros2 launch yahboomcar_multi robot1_amcl_launch.py

Enter the command in the Raspberry Pi terminal that starts robot2

xxxxxxxxxx
ros2 launch yahboomcar_multi robot2_amcl_launch.py

image-20240202114837970

As shown in the figure above, "Please set the initial pose..." appears. You can use the corresponding [2D Pose] tool to set the initial poses for the two cars respectively. According to the position of the car in the actual environment, Click and drag with the mouse in rviz, and the car model moves to the position we set. As shown in the figure below, if the area scanned by the radar roughly coincides with the actual obstacle, it means that the pose is accurate.

image-20240202114721908

Red represents robot1, blue represents robot2.

Note: If "Please set the initial pose..." cannot be printed on the terminal, it may be due to the data timestamp being out of sync. Press the reset button of the car and let the car reconnect to the agent to ensure that the data timestamp is correct. , and try again several times until "Please set the initial pose..." appears.

Source code location:/root/yahboomcar_ws/src/yahboomcar_multi/launch

robot1_amcl_launch.py

​x
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node

def generate_launch_description():
    #package_path = get_package_share_directory('yahboomcar_multi')
    #nav2_bringup_dir = get_package_share_directory('nav2_bringup')
    lifecycle_nodes = ['map_server']
    param_file = os.path.join(get_package_share_directory('yahboomcar_multi'),'param','robot1_amcl_params.yaml')
    amcl_node = Node(
        name="robot1_amcl",
        package='nav2_amcl',
        executable='amcl',
        parameters=[os.path.join(get_package_share_directory('yahboomcar_multi'),'param','robot1_amcl_params.yaml')],
        remappings=[('/initialpose', '/robot1/initialpose')],
        output = "screen"
    )
    
    life_node = Node(
        name="robot1_amcl_lifecycle_manager",
        package='nav2_lifecycle_manager',
        executable='lifecycle_manager',
        output='screen',
        parameters=[{'use_sim_time': False},{'autostart': True},{'node_names': ['robot1_amcl']}]
        )
        
    base_link_to_laser_tf_node = Node(
        package='tf2_ros',
        executable='static_transform_publisher',
        name='base_link_to_base_laser',
        namespace = 'robot1',
        arguments=['-0.0046412', '0' , '0.094079','0','0','0','robot1/base_link','robot1/laser_frame']
    )
    
    return LaunchDescription([
        #lifecycle_nodes,
        #use_sim_time,\
        amcl_node,
        life_node,
        base_link_to_laser_tf_node
    ])

amcl_node:Start the amcl node program, which is used to estimate pose and achieve positioning.

life_node:amcl node lifecycle manager

base_link_to_laser_tf_node:Static transformation of chassis and radar data

7、Start the car navigation program

Enter the command in the Raspberry Pi terminal that starts robot1

xxxxxxxxxx
ros2 launch yahboomcar_multi robot1_navigation_dwb_launch.py

Enter the command in the Raspberry Pi terminal that starts robot2

xxxxxxxxxx
ros2 launch yahboomcar_multi robot2_navigation_dwb_launch.py

image-20240202114752461

As shown in the picture above, if "Creating bond timer..." appears, it means that the program loading is complete. Then you can give the target points of the two cars through the corresponding [2D Goal Pose] on riviz. The cars combine their respective poses and poses. If there are surrounding obstacles, a path will be generated to autonomously navigate to their respective destinations.

image-20240202114806895

The yellow route is the route planned by robot1, and the green line is the route planned by robot2.

image-20240202114820931

8、Multi-vehicle navigation expansion

The tutorial takes two cars as an example. If you want to add other cars, you need to make the following modifications.

8.1、Add the URDF model of the car and add the urdf model loader

  • Added car model

    You can refer to /root/yahboomcar_ws/src/yahboomcar_description/urdf/MicroROS_robot1.urdf. Change the name and robot1 that appears in the urdf file to another car name, such as robot3.

  • Added urdf model loader

    You can refer to /root/yahboomcar_ws/src/yahboomcar_description/launch/description_multi_robot1.launch.py. Change the name and robot1 that appears in the launch file to another car name. The name needs to be consistent with the new urdf.

8.2、Added car ekf parameter table

You can refer to /root/yahboomcar_ws/src/yahboomcar_multi/param/ekf_robot1.yaml. Change the name and robot1 that appears in the file to another car name. The name needs to be consistent with the new urdf.

8.3、Added car amcl parameter table and launch file to start amcl

  • Added car amcl parameter table

    You can refer to /root/yahboomcar_ws/src/yahboomcar_multi/param/robot1_amcl_params.yaml. Change the name and robot1 that appears in the file to the name of other cars. The name needs to be consistent with the new urdf.

  • Add the launch file of amcl that is started

    You can refer to /root/yahboomcar_ws/src/yahboomcar_multi/launch/robot1_amcl_launch.py. Change the name and robot1 that appears in the file to the name of other cars. The name needs to be consistent with the new urdf.

8.4、Added car nav2 parameter table and launch file to start nav2

  • Added car nav2 parameter table

    You can refer to /root/yahboomcar_ws/src/yahboomcar_nav/params/robot1_nav_params.yaml. Change the name and robot1 that appears in the file to the name of other cars. The name needs to be consistent with the new urdf.

  • Added new launch file of nav2

    You can refer to /root/yahboomcar_ws/src/yahboomcar_multi/launch/robot1_navigation_dwb_launch.py. Change the name and robot1 that appears in the file to the name of other cars. The name needs to be consistent with the new urdf.

8.5、Added [2D Pose Estimate] and [2D Goal Pose] in the rviz toolbar

Modify the multi_nav.rviz file. The directory of this file is /root/yahboomcar_ws/src/yahboomcar_nav/rviz. Find the following section,

- Class: rviz_default_plugins/SetInitialPose
  Covariance x: 0.25
  Covariance y: 0.25
  Covariance yaw: 0.06853891909122467
  Topic:
    Depth: 5
    Durability Policy: Volatile
    History Policy: Keep Last
    Reliability Policy: Reliable
    Value: /robot1/initialpose
- Class: rviz_default_plugins/SetGoal
  Topic:
    Depth: 5
    Durability Policy: Volatile
    History Policy: Keep Last
    Reliability Policy: Reliable
    Value: /robot1/goal_pose

The above are the two tools of robot1. You can make a copy and put it behind. Change the robot1 that appears to the name of other cars. The name needs to be consistent with the new urdf.

After completing the above 5 steps, return to the yahboomcar_ws workspace, use colcon build to compile, and then run the test according to the tutorial. After running successfully, you can add the car model and radar data to display in rviz.

 

 

 

 

 

 

 

Multi-machine keyboard control
Introduction to Linux system

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文