Welcome to Transbot SE repository
3. Multi-robot robot arm dancing(Optional)
3. Multi-robot robot arm dancing(Optional)
3. Multi-robot robot arm dancing(Optional)3.1 Achievement effect3.2 Preparations before realization3.3 Record the running track of transbot se13.3.1 virtual machine 3.3.2 transbot se1 3.3.3. Start recording3.4 Record the running track of transbot se23.5 Modify the launch file3.6 Start3.7 Actual effect3.8 Principle of realization3.8.1 Introduction to rosbag
Tips: Transbot SE packing list didn't include handle, if you need complete this function, please purchase handles additionally.
Handle Link: https://category.yahboom.net/products/usb-ps2
3.1 Achievement effect
After running this program, multiple transbot se will move according to the track we programmed and recorded before, and the robotic arms will dance.
3.2 Preparations before realization
Before realizing this function, it is necessary to allow the virtual machine and transbot se to realize multi-machine communication, let transbot se act as a slave, and the virtual machine act as a host. As the central conductor, the virtual machine issues instructions to run performances. Let's take two transbot se as an example to demonstrate this function.
3.3 Record the running track of transbot se1
3.3.1 virtual machine
- Start roscore
roscore
- Start the handle control node
xxxxxxxxxxroslaunch transbot_ctrl transbot_joy_multi_arm.launch namespace:=robot1
3.3.2 transbot se1
1), start transbot1 chassis control node
jetson motherboard/Raspberry Pi 4B
xxxxxxxxxxroslaunch transbot_mulity transbot_mulity_control.launch namespace:=robot1
Raspberry Pi 5
Before running, please confirm that the large program has been permanently closed
Enter docker
Note: If there is a terminal that automatically starts docker, or there is a docker terminal that has been opened, you can directly enter the docker terminal to run the command, and there is no need to manually start docker
Start docker manually
xxxxxxxxxx./run_docker.sh

xxxxxxxxxxroslaunch transbot_mulity transbot_mulity_control.launch namespace:=robot1
3.3.3. Start recording
In a new terminal of the virtual machine type
xxxxxxxxxxrosbag record /robot1/cmd_vel /robot1/TargetAngle
This command will record the speed of transbot se1 at each moment, press ctrl+c after the recording, and a bag file named with the suffix .bag and the recording start time will be generated in the /home/yahboom directory.

3.4 Record the running track of transbot se2
For the recording method, refer to 3.3, just replace robot1 with robot2.
More bots and so on.
3.5 Modify the launch file
launch file location:
xxxxxxxxxx/home/yahboom/transbot_ws/src/transbot_ctrl/launch/play_robot_bag1.launch/home/yahboom/transbot_ws/src/transbot_ctrl/launch/play_robot_bag2.launch
- In play_robot_bag1.launch, replace the .bag file inside with the .bag file generated when transbot se1 was recorded just now

- In play_robot_bag2.launch, replace the .bag file inside with the .bag file generated when recording the transbot se2 running track just now

- More robots can create more play_robot_bag.launch files in the /home/yahboom/transbot_ws/src/transbot_ctrl/launch/ directory. Refer to the launch files of robot1 and robot2 for the naming method and content.
3.6 Start
3.6.1 If you want robot1 and robot2 to start separately
Start robot1, virtual machine terminal enter
xxxxxxxxxxroslaunch transbot_ctrl play_robot_bag1.launch
Start robot2, virtual machine terminal enter
xxxxxxxxxxroslaunch transbot_ctrl play_robot_bag2.launch
More bots and so on.
3.6.2 If you want to start all at once, enter the virtual machine terminal
xxxxxxxxxxroslaunch transbot_ctrl play_robot_show.launch
If you want to start more than 2 robots, you need to modify the files in the following directory
xxxxxxxxxx/home/yahboom/transbot_ws/src/transbot_ctrl/launch/play_robot_show.launch
Refer to the contents of robot1 and robot2 to add the robots that need to be started.

3.7 Actual effect
After starting, the transbot se will move according to the previously recorded trajectories.
3.8 Principle of realization
Use rosbag record to record the speed and arm angle of each car at each moment, and then use the rosbag play command to play the data packets. At this time, each car will receive the speed and arm angle commands, and follow the original trajectory sports.
3.8.1 Introduction to rosbag
The commonly used commands of rosbag are as follows (fix and filter are not used for the time being):
record:Record a bag package with the specified topic, you can record the contents of multiple topics in one packageinfo:Display basic information about a bag, such as which topics are includedplay:Play back one or more bag packagescheck:Check whether a bag can be played back and migrated in the current systemcompress:Compress one or more bag packagesdecompress:Unzip one or more bag packagesreindex:Reindex one or more broken bags