yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MicroROS Robot Expansion Board📖
01. 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
02. 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.Drive ESP32 WiFi camera
03. 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
04.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
05. Robot basic course
4.1 Robot information release
  • Robot information release
4.0 Preparation
  • 1. Write firmware
  • 2. How to install and use VM
  • 3. microROS control board configuration
  • 4. Connect to microROS agent
4.2 Robot keyboard control
  • Robot keyboard control
4.3 Robot handle control
  • Robot handle control
4.4 Robot state estimation
  • Robot state estimation
4.5 Line speed calibration
  • Line speed calibration
4.6 Angular velocity calibration
  • Angular velocity calibration
4.7 Robot URDF model
  • Robot URDF model
Download
  • Firmware And Code
  • VM_File
  • 3D Model File
  • ROS2_Basic_VM
Download ZIP

Welcome to MicroROS Robot Expansion Board repository

Robot information release

Robot information release

Note: The virtual machine needs to be in the same LAN as the car, and the ROS_DOMAIN_ID needs to be consistent. You can check [Must read before use] to set the IP and ROS_DOMAIN_ID on the board.

1. Program function description

After the car is connected to the agent, it will publish sensor data such as radar and imu. You can run commands in the supporting virtual machine/Raspberry Pi 5 to query this information. You can also publish control data of sensors such as speed and buzzer.

2. Query car information

2.1. Start and connect to the agent

Taking the supporting virtual machine as an example, enter the following command to start the agent:

sudo docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble udp4 --port 8090 -v4

image-20240102115129150

Then, turn on the car switch and wait for the car to connect to the agent. The connection is successful, as shown in the figure below.

image-20231215164706528

2.2. Query the car node information

Enter the following command in the terminal to query the node,

xxxxxxxxxx
ros2 node list

image-20231215165454729

Then enter the following command to query which topics the node has published/subscribed to,

xxxxxxxxxx
ros2 node info /YB_Car_Node

image-20231220110334013

It can be seen that the topics subscribed to include:

/beep:Buzzer control

/cmd_vel:Car speed control

/servo_s1:s1 servo gimbal control

/servo_s2:s2 servo gimbal control

Posted topics include:

/imu:imu module data

/odom:Odometer module data

/scan:Radar module data

We can also query the topic command and enter it in the terminal,

xxxxxxxxxx
ros2 topic list

image-20231220110433482

2.3. Query topic data

Query radar data,

xxxxxxxxxx
ros2 topic echo /scan

image-20231215170527461

Query imu data,

xxxxxxxxxx
ros2 topic echo /imu

image-20231215170635077

Query odom data,

xxxxxxxxxx
ros2 topic echo /odom_raw

image-20231215170820806

3. Publish car control information

3.1. Control the buzzer

First, query the relevant information about the following buzzer topics, enter it in the terminal,

xxxxxxxxxx
ros2 topic info /beep

image-20231215171054137

Learn that the data type is std_msgs/msg/UInt16. Then enter the following command to turn on the buzzer and enter in the terminal,

xxxxxxxxxx
ros2 topic pub /beep std_msgs/msg/UInt16 "data: 1"

image-20231215171304563

Enter the following command to turn off the buzzer, terminal input,

xxxxxxxxxx
ros2 topic pub /beep std_msgs/msg/UInt16 "data: 0"

image-20231215171355932

3.2. Release speed control information

We assume that the released car moves at a linear speed of 0.5 and an angular speed of 0.2, and the terminal input is,

xxxxxxxxxx
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.2}}"

image-20231215172334672

If parking, enter

xxxxxxxxxx
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"

image-20231215172535292

3.3. Control the gimbal servo

What needs to be noted here is that the range of s1 servo is [-90,90], and the range of s2 servo is [-90,20]. If the value exceeds the range, the servo will not rotate.

We assume that the s1 servo is controlled to rotate 30 degrees, and the terminal input is,

xxxxxxxxxx
ros2 topic pub /servo_s1 std_msgs/msg/Int32 "data: 30"

image-20231220110647836

In the same way, if the s2 servo is controlled to rotate -30 degrees, the terminal input will be

xxxxxxxxxx
ros2 topic pub /servo_s2 std_msgs/msg/Int32 "data: -30"

image-20231220110837675

 

ROS2 TF2 coordinate transformation
Write firmware

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/中文