Skip to content

ForceTorqueSensor: add API for newest measurement#449

Merged
scpeters merged 2 commits intomainfrom
scpeters/force_torque_measured_wrench_api
Jul 29, 2024
Merged

ForceTorqueSensor: add API for newest measurement#449
scpeters merged 2 commits intomainfrom
scpeters/force_torque_measured_wrench_api

Conversation

@scpeters
Copy link
Member

🎉 New feature

Needed for gazebosim/gz-sim#2268 and gazebosim/gz-sim#2391.

Summary

Currently the wrench data published by gz-transport is not available via the C++ API. This pull request adds an accessor to the most recent Wrench message that is identical to that published on gz-transport.

Test it

Build and run bin/INTEGRATION_force_torque

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

This allows the most recent Wrench message to be
accessed via the API instead of only via gz-transport.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
msgs::Wrench msg;
msgs::Wrench &msg = this->dataPtr->measuredWrench;
*msg.mutable_header()->mutable_stamp() = msgs::Convert(_now);
auto frame = msg.mutable_header()->add_data();
Copy link
Member Author

Choose a reason for hiding this comment

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

there is an issue here; working on a fix

Copy link
Member Author

Choose a reason for hiding this comment

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

it was adding a new key-value pair for the "frame_id" to the header map at every timestep. I've changed it in 738a9da to allocate the key-value pair in the constructor and update it at each timestep instead

Allocate the key-value pair in the constructor and update
it for each measurement.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@azeey
Copy link

azeey commented Jul 22, 2024

cc @bperseghetti

@scpeters scpeters merged commit fdf8e02 into main Jul 29, 2024
@scpeters scpeters deleted the scpeters/force_torque_measured_wrench_api branch July 29, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏛️ ionic Gazebo Ionic

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants