AndrejOrsula / pymoveit2

Basic Python interface for MoveIt 2 built on top of ROS 2 actions and services
BSD 3-Clause "New" or "Revised" License
136 stars 53 forks source link

Robot struggles to perform servoing in ign_simulation! #16

Closed kkishore9891 closed 2 years ago

kkishore9891 commented 2 years ago

Hello Andrej! This is not really a bug or an error but rather a poor performance problem

https://user-images.githubusercontent.com/34810513/177786142-2d180d71-9c13-4dec-bdb1-abc66aadcf04.mp4

As you can see here! The robot struggles to do the circular servo motion in ignition gazebo simulation.

https://user-images.githubusercontent.com/34810513/177786367-18a83c02-f3e0-4252-a137-3d2d50ccf3f1.mp4

But it seems to work ideally in fake simulation in Rviz.

Am I doing something wrong or is the moveit_servo not doing a good enough job with the ign gazebo simulation?

I tried to replicate these results with the UR5 robot that I have worked on and it seems to be facing a similar issue. Is there a solution to this problem?

kkishore9891 commented 2 years ago

Adding to the previous comment. Here is a similar issue I am facing with UR5 control as well. There is a keyboard control problem and then a pymoveit2 problem as well as shown.

https://user-images.githubusercontent.com/34810513/177787587-c8515b0a-6267-469d-8455-c05f20d41d41.mp4

In this video, the script does a barely good job at making the robot follow velocity commands.

https://user-images.githubusercontent.com/34810513/177787730-499a2c19-fd29-4af6-9736-03a9e2e1723f.mp4

In this video, the keyboard control is terrible.

https://user-images.githubusercontent.com/34810513/177787847-59115b11-959f-46b3-81cc-896a8b2970fa.mp4

This is the pymoveit circular motion script tried on the robot. I simply changed the program statement used in first video with the circular velocities statement which is used in the pymoveit2 examples.

AndrejOrsula commented 2 years ago

Hello, Yes, the default example is not expected to work well on all interfaces. It is just an example to demonstrate communication with Servo nodes after all. Servo performs worse if you use effort-only control interface inside simulation with simple PID controllers and semi-tuned gains (try to tune them if you want something better). You can try to use position control interface to go around this.

Then you can play with Servo parameters, frequency at which you publish commands, ... Try looking at MoveIt for more resources on this.

This issue is related to MoveIt 2 Servo and gz_ros2_control instead of pymoveit2. This repository does nothing except for providing a Python interface. Closing.