-
Notifications
You must be signed in to change notification settings - Fork 773
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
Triggered camera / multicamera plugins #687
Triggered camera / multicamera plugins #687
Conversation
I filed an issue with gazebo because the first triggered image looks different (and wrong) compared to subsequent images: |
double _hack_baseline) | ||
{ | ||
GazeboRosCameraUtils::Load(_parent, _sdf, _camera_name_suffix, _hack_baseline); | ||
|
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.
add another this->SetCameraEnabled(false);
here in this overloaded Load
function?
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.
good call
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.
squashed into 7875cbd
ros::spinOnce(); | ||
ros::Duration(0.1).sleep(); | ||
} | ||
EXPECT_EQ(images_received_, 2); |
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.
is there logic to filter out mgs close together? I'm getting an error:
[gazebo_plugins.rosunit-triggered_camera/cameraSubscribeTest][FAILURE]----------
/home/osrf/code/ian/gz_ws/src/gazebo_ros_pkgs/gazebo_plugins/test/camera/triggered_camera.cpp:103
Value of: 2
Expected: images_received_
Which is: 3
but the tests are passing on jenkins..
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.
hm...it is kind of a race condition, but it was pretty consistent on my machine
are you consistently getting this result?
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 pretty consistent when I was testing it before but I just ran the test 10 more times and it only failed once so likely a race condition.
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.
an alternative is to try to change the behavior so that each trigger signal leads to a new image. this would require a slight refactoring (use int
instead of bool
in a few places) but would be more predictable
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 think I've fixed the race condition in cb9f299. Now the plugin uses an int
to keep track of the number of triggers received from the topic.
00a0a97
to
6752f51
Compare
I just rebased on kinetic-devel in order to get the renamed distortion tests. |
6752f51
to
7875cbd
Compare
mmm the new builds are failing because |
@scpeters would you mind fixing the conflicts when you have some free time? Thanks. |
cb9f299
to
9cd1ae5
Compare
@j-rivero sorry for the delay; I just resolved the conflicts |
I tested locally with gazebo9 and the tests pass except for the barrel distortion test (as expected due to #681 ) |
maybe we aren't declaring an explicit dependency on it; let me check |
Someone else had the |
@ros-pull-request-builder retest this please |
1 similar comment
@ros-pull-request-builder retest this please |
@ros-pull-request-builder retest this please |
The builds are now unstable, with just the distortion camera test failures |
just tested everything again, works as expected. |
I've added the missing entry to |
* adds triggered cameras and multicameras * fix threaded event connection * use correct timestamp for images * remove compiler directives for old gazebo versions * update copyright dates and remove copied comments * test for triggered_camera * expect cameras don't subscribe to trigger topic * subscribe to trigger if CanTrigger is true * fix untriggered first image * fix race condition * change triggered camera test name * fix test * fix 16bit test name
This adds a plugin for triggered cameras and multicameras. These sensors do not publish unless triggered. They have an additional topic (default name
image_trigger
) that subscribes tostd_msgs/Empty
messages and will publish a single update after being triggered.Its maximum update rate is currently set by the
<update_rate>
sdf tag in the<sensor>
block. Under the hood. If you publish two trigger messages before the camera has a chance to publish, it will only publish once, since abool
is used to keep track of the trigger status. The test reflects this behavior.