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 · 3 comments
Open

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

odj3460 opened this issue Jan 10, 2024 · 3 comments
Labels
enhancement New feature or request

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?

@aalmrad
Copy link
Collaborator

aalmrad commented Oct 8, 2024

Hello, apologies for the late reply. We are recently trying to tackle the github issues on our repositories more actively. Apparently, the joints are listed in the right order everywhere in the relevant files and it seems that ros2_control is internally responsible for the order in which the joint states are being published and it is not clear how to control/modify this order. I do not know what part of your project requires the joint states in the correct order but did you try to reorder the joint states externally after receiving them from the /joint_states topic?

Best,
Abed

@aalmrad aalmrad added the enhancement New feature or request label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants