Welcome to MicroROS Self-balancing Robot Car repository
4.Connect to microROS agent
Connect to microROS agent
1. Enable agent
The ESP32 communication board parameters have been configured in the previous section. For users who have purchased the ROS-WiFi image transmission module, after the hardware connection is completed, while configuring the ESP32 communication board parameters, the WiFi and IP agent that the image transmission module needs to connect to will also be configured.
ESP32 communication board
If you use the factory virtual machine system, you can enter in the terminal:
xxxxxxxxxxsh ~/start_agent_computer.shIf you use a third-party virtual machine system, you need to install the docker development environment first, and open the terminal to enter:
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble udp4 --port 8899 -v4ROS-WiFi image transmission module (optional)
If you use the factory virtual machine system, you can enter in the terminal:
sh ~/start_Camera_computer.shIf you use a third-party virtual machine system, you need to install the docker development environment first, and open the terminal to enter:
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble udp4 --port 9999 -v42. Connect to the proxy
Turn on the robot power switch and automatically connect to the proxy.
ESP32 communication board
The connection is successful as shown in the figure below

Note: If the connection is not successful, please check and confirm the configuration parameters of the robot, whether it can be connected to the LAN normally, and whether the proxy IP address and port number correspond.
ROS-WiFi image transmission module (optional)
The connection is successful as shown in the figure below

Note: If the connection is not successful, please check and confirm whether the ROS-wifi image transmission module can be connected to the local area network normally and whether the proxy IP address corresponds.
3. Test ROS nodes
Open the ROS2 terminal environment and enter the following command to view the node name /YB_Car_Node
xxxxxxxxxxros2 node list

If there is a ROS-WiFi image transmission module, you can also see the node name /espRos/Esp32Node,

If you cannot search for /YB_BalanceCar_Node or /espRos/Esp32Node nodes, please check whether the ROS_DOMAIN_ID in the .bashrc file on the virtual machine/computer is consistent with the configuration on the ESP32 communication board. Only when they are consistent can the node information be searched, otherwise the car cannot perform AI vision gameplay.
