-
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
Expose optical frame in CameraSensor to be used by DepthCameraSensor #362
Expose optical frame in CameraSensor to be used by DepthCameraSensor #362
Conversation
Codecov Report
@@ Coverage Diff @@
## gz-sensors7 #362 +/- ##
===============================================
+ Coverage 69.71% 69.76% +0.04%
===============================================
Files 36 36
Lines 3959 3965 +6
===============================================
+ Hits 2760 2766 +6
Misses 1199 1199
|
2f2b073
to
327531a
Compare
This looks good now as far as the message containing the correct frame_id if set optical frame. |
include/gz/sensors/CameraSensor.hh
Outdated
@@ -146,6 +146,10 @@ namespace gz | |||
/// \todo(iche033) Make this function virtual on Harmonic | |||
public: bool HasInfoConnections() const; | |||
|
|||
/// \brief Get the camera optical frame | |||
/// \return The camera optical frame | |||
public: std::string OpticalFrameId() const; |
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.
public: std::string OpticalFrameId() const; | |
public: const std::string &OpticalFrameId() const; |
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.
I originally did this but the rest of the API returns string by value like FrameId()
.
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.
@azeey Let me know if I should still make the change.
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.
Not sure if the extra copy makes sense especially since this will be called every time a message is published. I'd vote for const ref. Maybe @iche033 can weigh in.
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.
yeah unfortunately it breaks API consistency but let's go with const &
since as it makes sense here, and we'll start doing this more in new APIs.
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.
I updated to return const&
a6f664f
to
08ce9c4
Compare
…ensor Signed-off-by: Levi Armstrong <levi.armstrong@gmail.com>
08ce9c4
to
488fcff
Compare
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.
LGTM!
Rerunning the Ubuntu CI. I think it had an infra issue. |
Summary
I was using DepthCameraSensor along with the ros_gz_bridge and noticed that the point cloud could not be visualized in rviz because the optical frame was not being assigned to the message being produced by this package.