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

Allow option to initialise robot in any starting state #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

justagist
Copy link

Currently, the plugin initialising joint commands using values from the initial_value parameter of state_interface in the ros2_control tag for each joint. This means the robot has to always start at the same configuration, which can be a problem in some cases.
This PR introduces option to initialise the robot at any joint state, by initialising the commands with the first joint state value received via joint_states_topic (if available while controller is loading).

Introduces the <param name="use_initial_states_as_initial_commands">true</param> tag to the plugin (defaults to false).

@SFhmichael
Copy link

This is what I need, thanks for your contribution @justagist.

@justagist
Copy link
Author

Hi @JafarAbdi, can you review this please?

@JafarAbdi
Copy link
Collaborator

Currently, the plugin initialising joint commands using values from the initial_value parameter of state_interface in the ros2_control tag for each joint. This means the robot has to always start at the same configuration, which can be a problem in some cases.

Should we use the initial_value from command_interface then?

Maybe a better option is to completely remove https://github.com/PickNikRobotics/topic_based_ros2_control/blob/main/src/topic_based_system.cpp#L80-L98 and set both state/command interfaces to nan

Do you mind sharing an example I can test? Thanks!

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

Successfully merging this pull request may close these issues.

3 participants