fzi-forschungszentrum-informatik / cartesian_controllers

A set of Cartesian controllers for the ROS1 and ROS2-control framework.
BSD 3-Clause "New" or "Revised" License
349 stars 100 forks source link

ROS2 Humble with physical UR10 #125

Closed Tahir-Rasheed-437 closed 11 months ago

Tahir-Rasheed-437 commented 1 year ago

Software versions

Problem description I have previously used the Cartesian Controllers in ROS1 melodic with actual UR10 and its works perfectly. However, i need to use the controller now in ROS2-humble. I have tested the simulation environment and it works great (ROS-devel branch), however, i cannot find a launch file that can link me with the real robot. I believe i used this launch file to control my actual UR in ROS1 but i believe it hasn't been exported to ROS2 yet? Is there any package/launch file that I can apply to control the Cartesian position/forces of the actual UR10?

Secondly, i was wondering, if there is any Cartesian twist controller (to command the Cartesian velocity) exists for UR10? I remember something in ROS1 in cartesian_ros_control repo but does it exist in ROS2? Please do guide me about it.

Thank you

stefanscherzinger commented 1 year ago

Hi @Tahir-Rasheed-437

I believe i used this launch file to control my actual UR in ROS1 but i believe it hasn't been exported to ROS2 yet?

The ROS2 version of this file is here and the configuration for a the controller_manager is here. You can use that as basis for controlling the actual UR10. I'll see if I can provide you with a working example later.

Secondly, i was wondering, if there is any Cartesian twist controller (to command the Cartesian velocity) exists for UR10?

I'm not completely sure. The cartesian_ros_control interface hasn't been ported yet, but there might be other controller interfaces or controllers available somewhere. If you want to control the robot somehow directly, e.g. with teleoperation, you could also consider using wrenches instead. Here is a nice method to control the robot with a 6d space mouse. I use that frequently for teaching tasks.

Tahir-Rasheed-437 commented 1 year ago

Hello @stefanscherzinger, thank you very much for your response. Actually i did tried this launch file, it works very well with in simulation but i am unable to run it with the UR10. if you can please provide me a working example that would be great.

Yes true. I was searching for the ROS2 version of cartesian_ros_control repo but yes as you said it hasn't been imported to ROS2 yet. I found that moveit_servo can be used for such a task (twist control). My current goal is to use the UR directly in position or twist based on the visual servoying feedback but later force/wrench control as well.

stefanscherzinger commented 1 year ago

My current goal is to use the UR directly in position or twist based on the visual servoying feedback but later force/wrench control as well.

Yes, that's what I was expecting and hoping for. If you don't need to follow exact velocity references, as would be required for industrial machining, e.g., then you can just scale the twist messages adequately and send them as wrench messages to force control. The benefit is that you steer the robot in visual servoing tasks in the respective directions, and additionally are well prepared in case of contact with the environment. This works great. The spacemouse actually outputs geometry_msgs/TwistSamped messages that I turn into geometry_msgs/WrenchStamped for the cartesian_force_controller.

if you can please provide me a working example that would be great.

I'll try to setup an example config and launch file.

Tahir-Rasheed-437 commented 1 year ago

@stefanscherzinger Perfect. I will try that. Thank you for the explanation and for setting up an example..

Tahir-Rasheed-437 commented 1 year ago

@stefanscherzinger May I kindly inquire if you had the chance to take a look at setting up an example? Thanks

stefanscherzinger commented 1 year ago

@Tahir-Rasheed-437

Sorry for not responding earlier! Unfortunately very busy these days.

May I kindly inquire if you had the chance to take a look at setting up an example?

Kind of. I set up a ROS2 Humble version here. I tried to test that with ursim, which behaves just like the real hardware. Unfortunately, the driver is currently crashing and I'm running out of time for today. You could see if this setup already clarifies some of your questions.

If I'm lucky, I'll get my hands on an actual UR10e tomorrow and test this.

stefanscherzinger commented 1 year ago

@Tahir-Rasheed-437

I just tested this on Humble and it works as expected.

When using this on your UR robot, remember to

Let me know if this works for you.

stefanscherzinger commented 1 year ago

@Tahir-Rasheed-437

Did that work out?

Tahir-Rasheed-437 commented 1 year ago

@stefanscherzinger

Thank you very much for the proposed solution. Apologize I was on parental leave for past 2 weeks. I Just joined back today and saw our UR10 not working. Something went wrong and its not starting up. We will try to fix it in the coming days and will then test your proposed solution as soon as our UR10 is fixed.

By the time being, I can try your proposed solution in coppeliasim simulator hopefully before the end of the week.

stefanscherzinger commented 11 months ago

Please re-open if anything is still unclear.

Tahir-Rasheed-437 commented 11 months ago

@stefanscherzinger Apologize for the late response. Due to summer vocations and other important commitments, i couldn't timely test your proposed solution. I finally been able to test today and it worked very well. Thank you once again for the setting up the working example. It would be great if you can mention the package cartesian_controllers_universal_robots in the readme so anyone who wants to test the cartesian controllers with UR's can directly link to the package.