-
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
Added trigger to BoundingBoxCamera #322
Added trigger to BoundingBoxCamera #322
Conversation
Signed-off-by: Valentina Vasco <[email protected]>
Signed-off-by: Valentina Vasco <[email protected]>
Signed-off-by: Valentina Vasco <[email protected]>
@@ -22,6 +22,7 @@ | |||
#include <string> | |||
|
|||
#include <gz/msgs/image.pb.h> | |||
#include <gz/msgs/boolean.pb.h> |
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.
alphabetize
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.
Addressed in d7bc027
src/BoundingBoxCameraSensor.cc
Outdated
public: bool isTriggeredCamera = false; | ||
|
||
/// \brief True if camera has been triggered by a topic | ||
public: bool isTriggered = false; | ||
|
||
/// \brief Topic for camera trigger | ||
public: std::string triggerTopic = ""; |
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: bool isTriggeredCamera = false; | |
/// \brief True if camera has been triggered by a topic | |
public: bool isTriggered = false; | |
/// \brief Topic for camera trigger | |
public: std::string triggerTopic = ""; | |
public: bool isTriggeredCamera{false}; | |
/// \brief True if camera has been triggered by a topic | |
public: bool isTriggered{false}; | |
/// \brief Topic for camera trigger | |
public: std::string triggerTopic{""}; |
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.
Addressed in d7bc027
src/BoundingBoxCameraSensor.cc
Outdated
|
||
if (this->dataPtr->triggerTopic.empty()) | ||
{ | ||
gzerr << "Invalid trigger topic name" << std::endl; |
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.
gzerr << "Invalid trigger topic name" << std::endl; | |
gzerr << "Invalid trigger topic name [" << this->dataPtr->triggerTopic << "]" << std::endl; |
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.
Addressed in d7bc027
src/BoundingBoxCameraSensor.cc
Outdated
gzdbg << "Camera trigger messages for [" << this->Name() << "] subscribed" | ||
<< " on [" << this->dataPtr->triggerTopic << "]" << std::endl; |
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.
gzdbg << "Camera trigger messages for [" << this->Name() << "] subscribed" | |
<< " on [" << this->dataPtr->triggerTopic << "]" << std::endl; | |
gzdbg << "Camera trigger messages for [" << this->Name() << "] subscribed" | |
<< " on [" << this->dataPtr->triggerTopic << "]" << std::endl; |
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.
Addressed in d7bc027
@@ -0,0 +1,228 @@ | |||
/* | |||
* Copyright (C) 2022 Open Source Robotics Foundation |
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.
* Copyright (C) 2022 Open Source Robotics Foundation | |
* Copyright (C) 2023 Open Source Robotics Foundation |
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.
Addressed in d7bc027
Signed-off-by: Valentina Vasco <[email protected]>
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.
Thanks for the contribution!
There are some minor lint issues picked up here: https://github.com/gazebosim/gz-sensors/actions/runs/4204430572/jobs/7404649199
Can you address these issues.
I also made a comment about ABI compatibility.
include/gz/sensors/CameraSensor.hh
Outdated
@@ -175,6 +176,10 @@ namespace gz | |||
/// \param[in] _scene Pointer to the new scene. | |||
private: void OnSceneChange(gz::rendering::ScenePtr /*_scene*/); | |||
|
|||
/// \brief Callback for triggered subscription | |||
/// \param[in] _msg Boolean message | |||
private: virtual void OnTrigger(const gz::msgs::Boolean &/*_msg*/); |
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.
looks like this changed the v-table layout maybe ABI-incompatible. We'll need to make this function non-virtual in gz-sensors7
. This can be made virtual later when we forward port to main
where we can break ABI.
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.
Done in b7ecaa5
Signed-off-by: Valentina Vasco <[email protected]>
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.
looks good to me. Tested with the bounding box camera example world in gz-sim and works as expected
Signed-off-by: Ian Chen <[email protected]>
Codecov Report
@@ Coverage Diff @@
## gz-sensors7 #322 +/- ##
===============================================
+ Coverage 69.80% 69.97% +0.16%
===============================================
Files 36 36
Lines 3898 3920 +22
===============================================
+ Hits 2721 2743 +22
Misses 1177 1177
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Valentina Vasco [email protected]
🎉 New feature
Closes #321
Summary
This adds the possibility to trigger a BoundingBoxCamera.
Test it
Checkout the branch https://github.com/vvasco/gz-sensors/tree/triggered_bounding_box_camera and run the
INTEGRATION_triggered_boundingbox_camera
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.