Franka Emika Panda connects the real manipulator

Posted by byronbailey on Mon, 27 Dec 2021 03:07:48 +0100

Franka Emika Panda connecting real manipulator (II)

In the virtual environment, the manipulator can be dragged. The next step is to connect the manipulator with PC and control the movement of the manipulator through plan.
Above[ Franka Emika Panda connecting real manipulator (I) ]Already mentioned how to configure the manipulator environment and how to drag the manipulator in the rviz simulation environment. The following is a record of some experience in learning panda robot in the past week, so as to "know the new temperature" in the future.

Preparation for connecting PC to manipulator

1. There is a lamp on the base of the manipulator, and the color of the lamp indicates different modes.
Blue: ready and ready to move
White: stop (you can drag the teaching at this time)
Yellow: error (when the robot is powered on just now, the base light displays yellow)
2. The PC is connected with the manipulator through the network cable. At this time, it should be noted that one end of the network cable is connected with the PC and one end is connected with the manipulator control cabinet (not the manipulator base).
3. The PC has set the static ip, open the browser and enter the website 172.16 0.2, you can see the following interface.
Open the joint lock under the Joints and the franka base light turns blue. Hand held external activation device, since the beginning of franka panda's exploration!

demo. Exploration of launch control franka manipulator

First, now panda_ moveit_ Create a demo in the Launch folder of config_ real. Launch file, first put demo Copy the entire contents of the launch file to the demo_real.launch. We try to control the manipulator by modifying this file.
Open demo_real.launch file, we can see:

<include file="$(find panda_moveit_config)/launch/move_group.launch">
    <arg name="planner" value="$(arg planner)" />
    <arg name="allow_trajectory_execution" value="true"/>
    <arg name="fake_execution" value="true"/>
    <arg name="info" value="true"/>
    <arg name="debug" value="$(arg debug)"/>
  </include>

At this point, fake_ The value of execution is "true". We understand the virtual execution, that is, simulation, at this time, so we first change true to false.
Attempted to run:

roslaunch panda_moveit_config demo_real.launch robot_ip:=172.16.0.2

The results show that:
Action client not connected. This problem bothered me for a long time and I read a lot of blogs. For example:
[Use moveit! Control the real manipulator (3) - modify the moveit configuration file to control the real manipulator (updated on September 27))]
This mentioned how to modify the function package generated by moveit to control the real robot. So I started to see if I needed to modify the yaml file and so on. The git function pack mentioned above includes panda_controller.yaml and other documents.
Open move_group.launch,

<include ns="move_group" file="$(find panda_moveit_config)/launch/trajectory_execution.launch.xml" if="$(arg allow_trajectory_execution)">
    <arg name="moveit_manage_controllers" value="true" />
    <arg name="moveit_controller_manager" value="panda" if="$(eval not arg('fake_execution') and not arg('load_gripper'))"/>
    <arg name="moveit_controller_manager" value="panda_gripper" if="$(eval not arg('fake_execution') and arg('load_gripper'))"/>
    <arg name="moveit_controller_manager" value="fake" if="$(arg fake_execution)"/>
  </include>

As can be seen from this paragraph, fake_ When the execution value is false, moveit_ controller_ The value of manager is panda, that is, the real robot, and there is no error.
Then why control or not?
[Control real robot arm via ROS (5) - Moveit! Real manipulator (modified by move_group and demo.launch)]
It turned out that moveit, as the client side, did not receive messages from the two nodes on the server side.
Open panda_controllers.yaml,

 controller_list:
  - name: position_joint_trajectory_controller
    action_ns: follow_joint_trajectory
    type: FollowJointTrajectory
    default: true
    joints:
      - panda_joint1
      - panda_joint2
      - panda_joint3
      - panda_joint4
      - panda_joint5
      - panda_joint6
      - panda_joint7

Name: Here you can write a name related to your robot for your convenience

action_ns:follow_joint_trajectory ,follow_joint_trajectory is a part of the name of subsequent actions. You need to fill in an action name, which is determined in the configuration file, that is, name / action_ The combination of corresponding strings represented by NS.

Type: followjointtractory. This type is the built-in action type under ros. It is a data structure that controls the motion trajectory of the manipulator. Please fill in it as it is. In the future, you may want to control structures such as hand grasping. The types filled in are different.

joints: here are the joint names of your robot (manipulator). These names are derived from your robot model file. Our controllers.yaml file is copied from the fake_controllers.yaml file. This part should be generated automatically.
Original link: https://blog.csdn.net/nmssg1/article/details/100665543
Here you can read this blog and explain action clearly:
[Robot learning must see series: how to use moveit to control a real manipulator?]
In short, communication is like a plug, and moveit is like a plug. It is ready, but the action server is not available. Of course, it cannot be powered on.

The problem is to figure it out, but what should we do next? This is difficult again.
Some bloggers suggest that they can write a node file by themselves. Before running the launch file, run the node to make position_ joint_ trajectory_ The controller is unblocked. But I have just come into contact with the robot. franka is a seven degree of freedom robot. It took me a few days to write a useful node file.
Here, first count the useful documents found before for subsequent learning.
[How does the trajectory generated by Moveit in ROS act on the actual manipulator (I)]
[How does the trajectory generated by Moveit in ROS work with the actual manipulator (2)]
[How does the trajectory generated by Moveit in ROS act on the actual robot (3)]
[Use moveit! Control the real manipulator (5) -- write the action service program in the real manipulator node]
[Moveit actual manipulator control (5) moveit, write the action server node and the node at the Arudion end]
[ROS learning note 16 - action of controlling real manipulator (large collection of examples)]
[Control real robot arm via ROS (5) - Moveit! Real manipulator (modified by move_group and demo.launch)]
[Use moveit! Control the real manipulator (4) -- understand the action used by moveit]
This road is temporarily blocked, and there are few tutorials on using ROS to control the franka panda manipulator to scratch the scalp (the hairline moves back buff).

Control manipulator

1. Test the connection of mechanical arm

ifconfig

Check whether the ip has been modified.

uname -r

Check whether the linux kernel is a real-time kernel.

ping 172.16.0.2

Check whether the PC can communicate with the manipulator.

cd ~/catkin_franka/libfranka/build/examples
./echo_robot_state 172.16.0.2
./communication_test 172.16.0.2

If this communication test fails, it indicates that the communication network is insufficient to control the robot.
2. Real time control of manipulator

roslaunch franka_example_controllers cartesian_impedance_example_controller.launch robot_ip:=172.16.0.2 load_gripper:=true

At this time, drag the robot arm in rviz, and the real robot arm will move in real time, so make sure there are no obstacles around.

cd ~/catkin_franka/libfranka/build/examples
./communication_test 172.16.0.2

Use this command to return the manipulator to its initial position.
3. plan and execution of manipulator

roslaunch franka_control franka_control.launch robot_ip:=172.16.0.2
roslaunch franka_gripper franka_gripper.launch robot_ip:=172.16.0.2
roslaunch panda_moveit_config panda_moveit.launch
roslaunch panda_moveit_config demo_real.launch

I thought about this method for a long time. Although I feel it belongs to a heresy, it can really realize the plan and execution of the manipulator after actual measurement.