Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can use effort controller in ros2_kortex (ActuatorConfig) #202

Open
odj3460 opened this issue Jan 10, 2024 · 2 comments
Open

How can use effort controller in ros2_kortex (ActuatorConfig) #202

odj3460 opened this issue Jan 10, 2024 · 2 comments

Comments

@odj3460
Copy link

odj3460 commented Jan 10, 2024

We are modifying hardware_interface based on the API torque-control example.
I want to be able to give torque input at low-level, i.e. switch to the ros-controller's effort controller.
As of now, I have set it that way, but the following error occurs.


[ros2_control_node-1] terminate called after throwing an instance of 'Kinova::Api::KDetailedException'
[ros2_control_node-1] what(): Server protocol error, Error sub type=UNSUPPORTED_SERVICE => <srv: 10, fct: 7, msgType: 3>
[ros2_control_node-1] description: Service not registered for service id: 10
[ros2_control_node-1]
[ros2_control_node-1] Stack trace (most recent call last) in thread 339292:
[ros2_control_node-1] #17 Object "", at 0xffffffffffffffff, in

However, even if I check the API-related documentation, I cannot find what 'service id:10' means.
Maybe, I think that this problem is on ''k_api::ActuatorConfig::ActuatorConfigClient''.

In the basic hardware_interface.cpp, it was stated that ros2_kortex is not provided for effort input.
But even if I modify the source file, is it currently not possible?

I would like to use a controller other than the default joint-trajectory-controller and twist-controller.

To be precise, it is a position-controller or effort-controller.
However, there are situations in which both of these low-level controls are not working well.
Are there any examples or guidelines for how to do this?

@smoya23
Copy link
Contributor

smoya23 commented Apr 11, 2024

Hi @odj3460,

It's not impossible to implement low-level effort controller inside the current hardware_interface, it was just not part of our defined supported feature set. Our example in the Kortex repo is a good starting point in order to get it to work inside our current hardware interface. Please note that you will also need to add the effort controller inside the ros2_controllers.yaml file of your arm description package (for a 6dof, it's located in here) . Regarding the error you're getting, is it possible for you to provide a code snippet of what is causing the error to happen? I can try and guide you from there.

Best,
Santiago

@odj3460
Copy link
Author

odj3460 commented Apr 22, 2024

Thank you for the answer.

Actually, this problem was already solved.
But, I have one more question.

When I run the hardware_interface, I can get the topic for joint_states from ros2_controller. The topic is '/joint_states'.
The problem is the configuration of the joint values.

From the topic, /joint_states is configured as [joint1 joint2 joint4 joint5 joint3 joint6]. Joint configuration order for joint 3-5 is wrong.
What's the reason for this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants