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

fixed mock hardware for botwheel explorer #28

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ErikParkerrr
Copy link

Goes along with this issue: #24

Pretty much everything was already setup in the official repo. The only thing missing was the command and state interfaces for the mock_components/GenericSystem plugin to recognize. I've assumed adding these will not break anything for the non-mock-hardware usage. If it will, it can be changed to be in an if statement.

Cheers

Copy link
Member

@samuelsadok samuelsadok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, yeah this approach is preferred. The files are in part derived from the diffbot example (e.g. this file) so this stub support was an artifact I wasn't aware of.

What command did you use to test this? When I tried it I saw that botwheel_explorer.launch.py needs some commented-out lines to be enabled to work with use_mock_hardware:=true. Please add these to the PR too.
image

@@ -18,12 +18,25 @@
</xacro:if>
<joint name="${prefix}left_wheel_joint">
<param name="node_id">0</param>
<command_interface name="velocity"/>
<command_interface name="position"/>
<command_interface name="torque"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torque needs to be renamed to effort (4x). Otherwise, when I try it with the real hardware interface, it crashes with:

[ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error'
[ros2_control_node-1]   what():  Wrong state or command interface configuration.
[ros2_control_node-1] missing state interfaces:
[ros2_control_node-1] ' left_wheel_joint/torque '       ' right_wheel_joint/torque '
[ros2_control_node-1] missing command interfaces:
[ros2_control_node-1] ' left_wheel_joint/torque '       ' right_wheel_joint/torque '

@ErikParkerrr
Copy link
Author

  • Fixed the issue you mentioned.
  • Allowed for the mock hardware argument to be passed through the launch file instead of editing the urdf directly like I was doing.
  • Un-commented the rviz launch argument and grabbed rviz file from ros2_control example
  • Added the materials file from the example so the urdf doesn't make references to non existent materials

Copy link
Member

@samuelsadok samuelsadok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok the launch command ros2 launch odrive_botwheel_explorer botwheel_explorer.launch.py use_mock_hardware:=true works now, however the original command from the docs (ros2 launch odrive_botwheel_explorer botwheel_explorer.launch.py) is still broken due to a typo.

Furthermore, please rebase the PR to the latest main branch so that the history/diff only shows commits/changes related to this PR. Currently it includes a bunch of changes from an unrelated PR.

<command_interface name="effort"/>
<state_interface name="position"/>
<state_interface name="velocity"/>
<state_interface name="effor"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here which prevents the launchfile from working

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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