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

FakeSystem initial_value does not seem to work correctly #622

Closed
AndyZe opened this issue Jan 20, 2022 · 5 comments · Fixed by #623
Closed

FakeSystem initial_value does not seem to work correctly #622

AndyZe opened this issue Jan 20, 2022 · 5 comments · Fixed by #623
Labels

Comments

@AndyZe
Copy link
Contributor

AndyZe commented Jan 20, 2022

I am launching one of the common test packages from MoveIt, the Panda. The ros2_control xacro is here:

https://github.com/ros-planning/moveit_resources/blob/ros2/panda_moveit_config/config/panda.ros2_control.xacro

I saw this deprecation warning:

[ros2_control_node-5] [WARN] [1642614151.127346724] [fake_generic_system]: The usage of initial_position has been deprecated. Please use 'initial_value' instead.

So I tried updating initial_position to initial_value in that ros2_control xacro file. Yet, the robot does not move to the initial position like it used to.

@AndyZe
Copy link
Contributor Author

AndyZe commented Jan 20, 2022

I wonder if it's because these joints have 2 state interfaces: position and velocity.

@AndyZe
Copy link
Contributor Author

AndyZe commented Jan 20, 2022

@destogl can I ask how this feature is supposed to work? I don't see any usage example in ros2_control_demos.

Is it:

<state_interface name="position" initial_value="0.0"/>
<state_interface name="velocity" initial_value="0.0"/>

or

                <param name="initial_value">0.0</param>
                <command_interface name="position" />
                <state_interface name="position"/>
                <state_interface name="velocity"/>

I hope it's option 1. Option 2 wouldn't make sense if there are multiple state interfaces.

@AndyZe
Copy link
Contributor Author

AndyZe commented Jan 20, 2022

OK, I finally got it working like this:

                <param name="initial_position">${initial_positions['panda_joint4']}</param>
                <param name="initial_velocity">${initial_positions['panda_joint4']}</param>
                <command_interface name="position"/>
                <state_interface name="position"/>
                <state_interface name="velocity"/>

Will make a small PR to give a warning to the user.

@wmmc88
Copy link
Contributor

wmmc88 commented Jan 22, 2022

@destogl can I ask how this feature is supposed to work? I don't see any usage example in ros2_control_demos.

Is it:

<state_interface name="position" initial_value="0.0"/>
<state_interface name="velocity" initial_value="0.0"/>

or

                <param name="initial_value">0.0</param>
                <command_interface name="position" />
                <state_interface name="position"/>
                <state_interface name="velocity"/>

I hope it's option 1. Option 2 wouldn't make sense if there are multiple state interfaces.

For anyone stumbling upon this looking for the new preferred syntax, there's an example in the test file:

<param name="initial_value">2.78</param>

@AndyZe
Copy link
Contributor Author

AndyZe commented Jan 22, 2022

Thanks @wmmc88!

pac48 pushed a commit to pac48/ros2_control that referenced this issue Jan 26, 2024
…-controls#622)

* Remove workflows for distros not supported on master

* Revert "Remove workflows for distros not supported on master"

This reverts commit e916af3b19ba8642312692328ebc71a2f92ac93c.

* Don't run humble workflows on master

Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants