-
Notifications
You must be signed in to change notification settings - Fork 196
Bridge DVL messages #789
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
base: jazzy
Are you sure you want to change the base?
Bridge DVL messages #789
Conversation
Signed-off-by: Carlos Agüero <caguero@osrfoundation.org>
…gs.hpp Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Carlos Agüero <cen.aguero@gmail.com>
hidmic
left a comment
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.
Sorry for the delay, first pass!
|
|
||
| // Unsupported. | ||
| for (auto j = 0; j < 9; ++j) { | ||
| beam->mutable_velocity()->add_covariance(0); |
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.
@caguero gz-sim accepts a null covariance matrix?
| ros_msg.range[numGoodBeams] = gz_msg.beams()[i].range().mean(); | ||
| ros_msg.range_covar[numGoodBeams] = gz_msg.beams()[i].range().variance(); | ||
| ros_msg.beam_quality[numGoodBeams] = gz_msg.beams()[i].rssi(); | ||
| gz::math::Vector3d v = gz::msgs::Convert(gz_msg.beams()[i].velocity().mean()); |
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.
@caguero nit: can be const
| ros_msg.beam_unit_vec[numGoodBeams].x = -1; | ||
| ros_msg.beam_unit_vec[numGoodBeams].y = -1; | ||
| ros_msg.beam_unit_vec[numGoodBeams].z = -1; |
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.
@caguero why not use the normalized mean velocity vector? I don't know if the frames match but we are already assuming they do for the ros to gz conversion.
| compareTestMsg(std::make_shared<gz::msgs::Header>(_msg->header())); | ||
| EXPECT_EQ(expected_msg.type(), _msg->type()); | ||
| // compareTestMsg(std::make_shared<gz::msgs::DVLTrackingTarget>(_msg->target())); | ||
| // compareTestMsg(std::make_shared<gz::msgs::DVLKinematicEstimate>(_msg->velocity())); |
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.
@caguero why are these commented out?
| ros_msg.course_gnd = std::atan2(ros_msg.velocity.y, ros_msg.velocity.x); | ||
| ros_msg.speed_gnd = std::sqrt(ros_msg.velocity.x * ros_msg.velocity.x + ros_msg.velocity.y * | ||
| ros_msg.velocity.y); |
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.
@caguero meta: I would double check frames are correct. It's not clear to me what the ROS message definition means by ground speed.
ahcorde
left a comment
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.
do you mind to take a look to @hidmic comments too ?
🎉 New feature
Closes #741
Summary
This patch adds support to bridge DVL messages.
I'm using this DVL message definition in the ROS side and this one on the Gazebo side.
I'm opening this PR as a draft because we still need to figure out some discrepancies between messages. I'll start with the Gazebo -> ROS conversion. I invoke @rolker and @hidmic . I'd love you two to join the discussion if have some spare cycles. cc/ @bsb808.
Gazebo -> ROS Discussion
altituderequires to know the location of the DVL beams with respect to the vehicle. I don't think we have the pose of the sensor in the Gazebo message. We could potentially include aposein theDVLBeamStatemessage. At the same time this will be a redundant message sent over and over all the time.num_good_beams. How that field should be used? If this field tells me only two beams are good, which of the four beams are the two good ones? Should their elements be rearranged within the array in a way that the two first ones are the good ones? Or this is just purely informative but it shouldn't be used as an index in the arrays. Gazebo has thelockedfield in each beam which captures the same spirit. Should the "bad beams" be completely ignored? That's what I'm trying to do when copying the data into Gazebo.sound_speedisn't supported in Gazebo.-1for now? Add a field inDVLVelocityTracking? Is1500a good default value?beam_unit_vec: See (1).beam_quality. I'm associating it torssibut we could also set it to-1if it's too specific.velocity_covaris afloat32. In Gazebo this is a 3x3 matrix. I guess we have three variance values in the diagonal in Gazebo, one for each velocity component. Do you have a suggestion about how to populate thevelocity_covarfor each beam here?Checklist
codecheckpassed (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-byandGenerated-bymessages.