1、Robotic arm control

Website:http://docs.ros.org/en/melodic/api/moveit_tutorials/html/index.html

HD camera MoveIt:~/software/transbot_library/src/transbot_config_camera

Astra_MoveIt:~/software/transbot_library/src/transbot_config_astra

Robotic arm control function package:~/software/transbot_library/src/transbot_description

Before usingg this function, we need to close the APP remote control process and all the functions that have been turned on. MoveIT recommends running in a virtual machine.

(The computer must have a discrete GPU!!!)

1.1、Start up

This lesson is mainly to realize the synchronous operation of the real machine and MoveIT simulation. Take Raspberry Pi and monocular camera configuration as an example, the Astra configuration is similar. It is recommended to set the virtual machine as the host. MoveIT will start slowly. After starting in the virtual machine, set Raspberry Pi as the slave.

Virtual machine side (Host)

Raspberry Pi side(Slave)

The MoveIt simulation environment start up need some time, wait patiently, observe the terminal.

If an error as shown in the figure below appears.

Solution: If the terminal reports an error and the motion planning library is not loaded, click [Reset] in the lower left corner to reload.

During the loading process, don't rush to click [Reset].

If you click before loading, the system will reload, which will cause it to fail to start.

image-20210922162354143

image-20210922162404081

As shown in the figure below, if [Replanning: yes] appears on the terminal and a green [OMPL] appears in Planning Library, which means system be started up successfully.

image-20210922162410696

As shown below.

image-20210922162416722

After the startup is successful, as shown in the figure above, slide the sliding bar of [joint_state_publisher_gui], and the robot arm and camera servo pan/tilt will make corresponding actions.

During the operation, do not slide too fast to avoid accidents.

【camera_joint1】:The camera servo pan/tilt rotates left and right, the left is positive and the right is negative.

【camera_joint2】:The camera servo pan/tilt rotates up and down, up and down.

【arm_joint1】:The servo close to the car body, the smaller the data, it is lower.

【arm_joint2】:The second servo of the robotic arm, the smaller the data, it is lower.

【Jaws_joint】:The gripper, the smaller the data, the gripper will open bigger angle.

【Randomize】:Randomly generate actions. Without safety protection measures, clicks are not allowed, which is very dangerous! ! !

【Center】:One-key middle. When it is first opened, it is in the centering position by default. Click at this time, and no response can be seen.

 

1.2、Source code analysis

demo.launch

At startup, the GUI controller and rviz are set up.

py file: 03_machine_move.py

Subscribe to the topic [/joint_states] published by MoveIt to get the current position of the robot in MoveIt.

Callback【JointTopic】

Take a HD camera as an example, print [msg.name] and [msg.position] messages as follows:

The content of [msg.name] corresponds to [joint_state_publisher_gui], ['camera_joint1','camera_joint2','arm_joint1','arm_joint2','Jaws_joint'] is what we need to pay attention to.