flexivrobotics / flexiv_ros2

ROS 2 integration of RDK for Flexiv robots.
Apache License 2.0
25 stars 11 forks source link

RDK Timeliness Monitor error when using moveit2 to control the real rizon4 robotic arm #31

Closed AGREATAPE closed 6 months ago

AGREATAPE commented 7 months ago

Hi,I am trying to use moveit2 to control the real rizon4 robotic arm, but when I click the excute button to let the robotic arm perform motion, the robotic arm always reports an error. As shown below: image Any solution? Thanks.

munseng-flexiv commented 7 months ago

@AGREATAPE

Hello please give us more details about the environment you use e.g. ROS 2 version (Foxy or Humble), Ubuntu OS version, flexiv_ros2 release version, RCA version.

Make sure you follow the steps in the README to enable RDK on the robot server and establish connection between the workstation PC and the robot.

RDK timeliness monitor reports fault if the command messages are not sent to the robot at 1000 Hz.

AGREATAPE commented 7 months ago

@AGREATAPE

Hello please give us more details about the environment you use e.g. ROS 2 version (Foxy or Humble), Ubuntu OS version, flexiv_ros2 release version, RCA version.

@munseng-flexiv Hi,my environment is deployed on docker: ROS2 humble;Ubuntu 22.04.3 LTS;flexiv_ros2 humble v0.9.1; RCA 2.10.8;

RDK timeliness monitor reports fault if the command messages are not sent to the robot at 1000 Hz.

How do I get the frequency of command messages?I would check this first.

munseng-flexiv commented 7 months ago

@AGREATAPE

the update rate of the ros2 controller manager is specified in the rizon_controllers.yaml file. I don't think there's command line interface to monitor the update rate of the controller (default controller is joint trajectory controller in position interface).

For topic, you can check the publish rate using ros2 topic hz, e.g.

ros2 topic hz /joint_states
AGREATAPE commented 7 months ago

@munseng-flexiv The update rate of the ros2 controller manager is specified in the rizon_controllers.yaml file as 1000hz. I used the hz command to check /joint_states, it seems that it is only about 950. This may be the cause of the problem. Is there any solution?

munseng-flexiv commented 7 months ago

@AGREATAPE

Could you reproduce the error in another workstation PC or another environment setup? The latency problem is probably due to the setup environment.

I tested with the ROS 2 Humble docker and had no problem.

AGREATAPE commented 7 months ago

@munseng-flexiv Yes, I've tried this in two computers and both have similar issues; I deployed the same ROS 2 Humble docker as you tested; I found some problems after testing:If it is on the host, the update rate can reach a stable 1000hz, but once it is deployed in docker, the update rate will be stable at a random value between 950 ~ 999hz.

munseng-flexiv commented 7 months ago

@AGREATAPE

You can refer to the RDK Establish Connection guide to check the latency complies with the requirement listed in System Setup.

ping <robot_ip>

The time value from the ping command denotes the round trip latency. For real-time access (ROS 2) to the robot, the round trip latency must be lower than 1 ms.

You can refer to the Real-time kernel setup if you want to patch the Linux real-time kernel.

AGREATAPE commented 7 months ago

@munseng-flexiv I checked the round trip latency is 0.2ms; Now I am even more suspicious that the problem is between ros2,moveit2 and docker, because even if I use fake_system, the problem of decreased update rate still occurs in docker.

munseng-flexiv commented 6 months ago

Issue closed as the issue is due to the user setup environment.

The driver is set to use RT mode as default. You can modify the driver to NRT mode by changing the RDK API functions in the flexiv_hardware/src/flexiv_hardware_interface.cpp file if your PC is not able to send RT commands in 1 kHz.