Control and following of the robot arm
1 Slider Control
Open a command line and run:
# The default serial port name of the mybuddy is "/dev/ttyACM0", and the baud rate is 115200".
roslaunch mybuddy slider_control.launch _port:=/dev/ttyACM0 _baud:=115200
rviz and a slider component will be opened, and you will see the following interface:
Then you can control the model in rviz to make it move by dragging the slider. If you want the real mybuddy to move with the model, you need to open another command line and run:
# The default serial port name of the mybuddy is "/dev/ttyACM0", and the baud rate is 115200".
rosrun mybuddy slider_control.py _port:=/dev/ttyACM0 _baud:=115200
Note: Since the robot arm will move to the current position of the model when the command is input, make sure that the model in rviz does not appear to be worn out before you use the command.
Do not drag the slider quickly after connecting the robot arm to prevent damage to the robot arm.
2 Model Following
In addition to the above controls, we can also let the model move by following the real robot arm. Open a command line and run:
# The default serial port name of the mybuddy is "/dev/ttyACM0", and the baud rate is 115200".
rosrun mybuddy follow_display.py _port:=/dev/ttyACM0 _baud:=115200
Then open another command line and run:
roslaunch mybuddy mybuddy_follow.launch
It will open rviz to show the model following effect.