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

Enable setting default position of the simulated robot using ros2_control URDF tag. #100

Merged
merged 5 commits into from
Jan 28, 2022

Conversation

destogl
Copy link
Member

@destogl destogl commented Nov 23, 2021

Adds support for initial robot's position through ros2_control URDF tag.
This is also compatible with "FakeHardware" and can be used within the driver if needed.

Related PRs are:

The example joint definition looks like (example from UR driver):

     <joint name="${prefix}shoulder_pan_joint">
        <command_interface name="position"/>
        <state_interface name="position">
          <param name="initial_value">${initial_positions['shoulder_pan_joint']}</param>  <!-- initial position for Simulators and FakeHardware -->
        </state_interface>
        <state_interface name="velocity"/>
        <state_interface name="effort"/>
      </joint>

This feature is already released in ros2_control, but not synced yet.

I am not sure about one thing: Do we need a separate example for this?

@bmagyar
Copy link
Member

bmagyar commented Nov 23, 2021

Sounds like a good idea and would save some headache with artificial homing, etc.

What do you think if all the defaults were collected under a separate tag within the gazebo component?

hand-wavy example

<system name="gazebosystem">
  <initial_state>
    <joint name="shoulder_pan_joint" position="1.0 "/>
    <joint name="shoulder_tilt_joint" position="0.5 "/>
    <joint name="gripper_joint" position="1.0" effort="0.0 "/>
  </initial_state>
</system>

alternatively, extending your example

     <joint name="${prefix}shoulder_pan_joint">
        <command_interface name="position"/>
        <state_interface name="position" initial_value="${initial_positions['shoulder_pan_joint']}"/>
        <state_interface name="velocity"/>
        <state_interface name="effort"/>
      </joint>

@destogl
Copy link
Member Author

destogl commented Nov 25, 2021

I am more on the second approach. Because then we can reuse this in other cases like FakeSystem. Moreover, the information is available for hardware drivers if needed. (I could imagine it in some cases at least.)

@destogl
Copy link
Member Author

destogl commented Jan 26, 2022

@ahcorde I removed the new files as discussed. Can you please do one more check? After Friday's sync this should be buildable.

@ahcorde
Copy link
Collaborator

ahcorde commented Jan 27, 2022

@destogl can you merge with master?

…trol URDF tag.

Signed-off-by: Denis Štogl <denis@stogl.de>
Signed-off-by: Denis Štogl <denis@stogl.de>
@destogl destogl force-pushed the add-support-for-initial-position branch from 6612d8f to 0f383d7 Compare January 27, 2022 12:51
@destogl
Copy link
Member Author

destogl commented Jan 27, 2022

@destogl can you merge with master?

@ahcorde I just rebased it. can you please enable workflows again.

@ahcorde
Copy link
Collaborator

ahcorde commented Jan 27, 2022

Just one last thing @destogl , linters! https://github.com/ros-simulation/gazebo_ros2_control/runs/4966401765?check_suite_focus=true

@destogl destogl force-pushed the add-support-for-initial-position branch 2 times, most recently from bb285ba to cd9baf8 Compare January 27, 2022 22:55
@destogl
Copy link
Member Author

destogl commented Jan 27, 2022

@ahcorde done

Signed-off-by: Denis Štogl <denis@stogl.de>
Signed-off-by: Denis Štogl <denis@stogl.de>
Signed-off-by: Denis Štogl <denis@stogl.de>
@destogl destogl force-pushed the add-support-for-initial-position branch from cd9baf8 to a9e38c1 Compare January 27, 2022 22:59
@ahcorde ahcorde merged commit 26216b4 into ros-controls:master Jan 28, 2022
@destogl destogl deleted the add-support-for-initial-position branch January 28, 2022 08:54
ksotebeer pushed a commit to ksotebeer/gazebo_ros2_control that referenced this pull request Jun 14, 2022
…trol URDF tag. (ros-controls#100)

Signed-off-by: Denis Štogl <denis@stogl.de>
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.

None yet

3 participants