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
|
|
||
| /// \brief Get the camera optical frame | ||
| /// \return The camera optical frame | ||
| public: std::string OpticalFrameId() const; |
There was a problem hiding this comment.
| public: std::string OpticalFrameId() const; | |
| public: const std::string &OpticalFrameId() const; |
There was a problem hiding this comment.
I originally did this but the rest of the API returns string by value like FrameId().
There was a problem hiding this comment.
@azeey Let me know if I should still make the change.
There was a problem hiding this comment.
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.
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.
I updated to return const&
a6f664f to
08ce9c4
Compare
…ensor Signed-off-by: Levi Armstrong <levi.armstrong@gmail.com>
08ce9c4 to
488fcff
Compare
|
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.