Kinovarobotics / kortex

Code examples and API documentation for KINOVA® KORTEX™ robotic arms
https://www.kinovarobotics.com/
Other
107 stars 84 forks source link

using kortex_api in ROS (low-level) #176

Open odj3460 opened 12 months ago

odj3460 commented 12 months ago

Summary

I am currently utilizing two Gen3 robots for my project.

I have attempted control using the kortex_driver, but I found the control cycle to be slow, which has led me to consider using the API directly. I intend to control the robot through low-level servoing, and I also need to use additional external sensors, for which I plan to use ROS.

I am wondering if there might be any issues with controlling the robot through the API within ROS?

From what I understand based on other issues and discussions, it seems the maximum control rate with ROS is 40Hz, but I am assuming this limitation applies specifically to the kortex_driver. I am curious to know if it is possible to achieve a control rate of over 100Hz using low-level control through the API within ROS?

Additionally, I would appreciate if you could provide me with any examples or resources related to this topic.

Use case

Dual arm manipulation with FT sensors (ROS) (1000hz)

felixmaisonneuve commented 12 months ago

Hi @odj3460,

You can control the gen3 arm via the API within ROS, but the low-level API is not available in the current implementation of the driver.

I suppose it would be possible to modifiy the kortex_driver to support low-level, but this is no easy task. If you manage to implement such thing, you will need to change the rate to 1000Hz. This is an API requirement and you will may experience issues if you are not communicating at exactly 1ms intervals (being above 100Hz will not be enough).

I do not think anyone has implemented this low-level support in our ROS stack, so no resources are available on this topic. We usually recommand using the API directly when low-level is required. Low-level using the API is well documented and you can find examples on our other Kortex repo https://github.com/Kinovarobotics/kortex/blob/master/api_cpp/examples/107-Gripper_low_level_command/01-gripper_low_level_command.cpp https://github.com/Kinovarobotics/kortex/blob/master/api_cpp/examples/108-Gen3_torque_control/01-torque_control_cyclic.cpp https://github.com/Kinovarobotics/kortex/blob/master/api_cpp/examples/200-Actuator_low_level_control/01-actuator_low_level_velocity_control.cpp

Best, Felix

odj3460 commented 12 months ago

Felix, Thank you for your answer

I'm not sure I understood your answer correctly. What I want to do is not to use the kortex_driver package, but to create a separate ros package and write the code to run the API inside it.

Even if it's configured that way, is it difficult to implement low-level control using the API directly within ros? Then, is it usually impossible to integrate with measurements from external sensors using ROS when you want to control the Kinova Gen3 robot at a low level?

felixmaisonneuve commented 12 months ago

I have been told that some people tried to increase the ROS rate in our driver and they only managed to get to ~200-300Hz, which is not enough to support low-level. This would make it impossible to implement anything in ROS to use the low-level API of the arm.

odj3460 commented 12 months ago

Then, it seems pointless to build a system to utilize the API within ROS.

As I understand, in the low-level, we are unable to use the API for the information related to the interface configuration attached to the end of the robot. So, does it mean that if we use the low-level API, we are unable to build a system integrated with external sensors?

felixmaisonneuve commented 11 months ago

I am not sure what interface configuration you refer too. Can you please detail on that?

odj3460 commented 11 months ago

Ultimately, what I want to do is to integrate the Kinova api (low-level) and the FT sensor with ROS, controlling the robot at a rate of 1000hz.

The 'interface configuration' mentioned in the previous response refers to the method of connecting end-effector devices via UART or GPIO and using the related APIs.

As I previously mentioned, if the low-level API does not work within ROS in the way I want, do I need to use external sensors through the interface configuration? If so, do the interface-related APIs in the Kortex API operate at 1000hz?

felixmaisonneuve commented 11 months ago

The low-level API does not work within ROS.

It is possible, even in low-level, to use the Interconnect interface. You can call the any function of the InterconnectConfig even in low-level (so at a 1000Hz rate). For example, you do not need to be in high-level to use InterconnectConfig.SetUARTConfiguration(uartConfig).

madan96 commented 7 months ago

Hi @odj3460 , you could try out our ROS HW interface https://github.com/empriselab/kortex_hardware which provides support for effort mode at 1khz.