-
Notifications
You must be signed in to change notification settings - Fork 58
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
ForceTorqueSensor: add API for newest measurement #449
Conversation
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>
src/ForceTorqueSensor.cc
Outdated
@@ -247,7 +250,7 @@ bool ForceTorqueSensor::Update(const std::chrono::steady_clock::duration &_now) | |||
applyNoise(TORQUE_Y_NOISE_N_M, measuredTorque.Y()); | |||
applyNoise(TORQUE_Z_NOISE_N_M, measuredTorque.Z()); | |||
|
|||
msgs::Wrench msg; | |||
msgs::Wrench &msg = this->dataPtr->measuredWrench; | |||
*msg.mutable_header()->mutable_stamp() = msgs::Convert(_now); | |||
auto frame = msg.mutable_header()->add_data(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
🎉 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
codecheck
passed (See contributing)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.