-
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
[gazebo_plugins] Fix for issue #408 - correct the timestamp used by the camera #410
[gazebo_plugins] Fix for issue #408 - correct the timestamp used by the camera #410
Conversation
There's a gzserver failure in the travis test:
|
Can the travis ci build be triggered for 596b302? That had no code changes to the depth camera, but ran it the depth camera in a test which might indicate some other issue that is independent of my changes. The test should still fail, but because of timestamp issues, not the px assertions. The test that fails wouldn't actually be enabled when merged (the test |
I don't have permissions to trigger builds for a specific commit. I'll try making a separate branch... |
I pushed 596b302 to my fork ( scpeters@596b302 ) and am awaiting the travis results: https://travis-ci.org/scpeters/gazebo_ros_pkgs/builds/125919069 |
Yeah it is the same I think this test out to be commented out and the set_model_state-test test restored. But can someone other than me try out the changes manually (both running the tests and loading the depth, multi, and regular camera world files in a regular session and viewing published topics). |
I was able to reproduce the error when there is no valid
I think that a virtual framebuffer would be enough, @iche033 what do you think?
I'm interested into enabling all the possible tests. To run the test one by one we can use the -j1 argument. Maybe we can this option: -- a/gazebo_plugins/CMakeLists.txt
+++ b/gazebo_plugins/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.3)
project(gazebo_plugins)
+option(ENABLE_DISPLAY_TESTS "Enable the building of tests that requires a display" ON)
+
find_package(catkin REQUIRED COMPONENTS
message_generation
gazebo_msgs
@@ -339,22 +341,23 @@ install(DIRECTORY test
# Tests
if (CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
- # add_rostest_gtest(set_model_state-test
- # test/set_model_state_test/set_model_state_test.test
- # test/set_model_state_test/set_model_state_test.cpp)
- # target_link_libraries(set_model_state-test ${catkin_LIBRARIES})
-
- # Can't run these and the above test together
- add_rostest_gtest(depth_camera-test
- test/camera/depth_camera.test
- test/camera/depth_camera.cpp)
- target_link_libraries(depth_camera-test ${catkin_LIBRARIES})
- # add_rostest_gtest(multicamera-test
- # test/camera/multicamera.test
- # test/camera/multicamera.cpp)
- # target_link_libraries(multicamera-test ${catkin_LIBRARIES})
- # add_rostest_gtest(camera-test
- # test/camera/camera.test
- # test/camera/camera.cpp)
- # target_link_libraries(camera-test ${catkin_LIBRARIES})
+ add_rostest_gtest(set_model_state-test
+ test/set_model_state_test/set_model_state_test.test
+ test/set_model_state_test/set_model_state_test.cpp)
+ target_link_libraries(set_model_state-test ${catkin_LIBRARIES})
+
+ if (ENABLE_DISPLAY_TESTS)
+ add_rostest_gtest(depth_camera-test
+ test/camera/depth_camera.test
+ test/camera/depth_camera.cpp)
+ target_link_libraries(depth_camera-test ${catkin_LIBRARIES})
+ add_rostest_gtest(multicamera-test
+ test/camera/multicamera.test
+ test/camera/multicamera.cpp)
+ target_link_libraries(multicamera-test ${catkin_LIBRARIES})
+ add_rostest_gtest(camera-test
+ test/camera/camera.test
+ test/camera/camera.cpp)
+ target_link_libraries(camera-test ${catkin_LIBRARIES})
+ endif()
endif()
Test are failing on my local system:
|
So if the new code wasn't working at all the time difference would be more than 2 seconds (the update period of the sensor in the test world file)- and looking now my computer is taking about 0.3 seconds. I just chose 0.5 thinking it was generous at the time, but it could be increased to say 1.0. If any more is required I'd like to decrease the sensor update rate to get a more generous margin on both sides. |
Sounds fine to me to relax the tolerances |
Thanks for the fixes. Now I only have one error if I run the test locally on my Intel laptop:
To able to keep our CI headless working, can we please try to merge my previous proposed patch (I've changed the default not to run DISPLAY tests): -- a/gazebo_plugins/CMakeLists.txt
+++ b/gazebo_plugins/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.3)
project(gazebo_plugins)
+option(ENABLE_DISPLAY_TESTS "Enable the building of tests that requires a display" OFF)
+
find_package(catkin REQUIRED COMPONENTS
message_generation
gazebo_msgs
@@ -339,22 +341,23 @@ install(DIRECTORY test
# Tests
if (CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
- # add_rostest_gtest(set_model_state-test
- # test/set_model_state_test/set_model_state_test.test
- # test/set_model_state_test/set_model_state_test.cpp)
- # target_link_libraries(set_model_state-test ${catkin_LIBRARIES})
-
- # Can't run these and the above test together
- add_rostest_gtest(depth_camera-test
- test/camera/depth_camera.test
- test/camera/depth_camera.cpp)
- target_link_libraries(depth_camera-test ${catkin_LIBRARIES})
- # add_rostest_gtest(multicamera-test
- # test/camera/multicamera.test
- # test/camera/multicamera.cpp)
- # target_link_libraries(multicamera-test ${catkin_LIBRARIES})
- # add_rostest_gtest(camera-test
- # test/camera/camera.test
- # test/camera/camera.cpp)
- # target_link_libraries(camera-test ${catkin_LIBRARIES})
+ add_rostest_gtest(set_model_state-test
+ test/set_model_state_test/set_model_state_test.test
+ test/set_model_state_test/set_model_state_test.cpp)
+ target_link_libraries(set_model_state-test ${catkin_LIBRARIES})
+
+ if (ENABLE_DISPLAY_TESTS)
+ add_rostest_gtest(depth_camera-test
+ test/camera/depth_camera.test
+ test/camera/depth_camera.cpp)
+ target_link_libraries(depth_camera-test ${catkin_LIBRARIES})
+ add_rostest_gtest(multicamera-test
+ test/camera/multicamera.test
+ test/camera/multicamera.cpp)
+ target_link_libraries(multicamera-test ${catkin_LIBRARIES})
+ add_rostest_gtest(camera-test
+ test/camera/camera.test
+ test/camera/camera.cpp)
+ target_link_libraries(camera-test ${catkin_LIBRARIES})
+ endif()
endif() ` |
…me that gazebo generated the sensor data, so ought to be used. updateRate doesn't seem that useful. The other cameras need similar fixes to have the proper timestamps.
…amps are currently outdated, will fix them similar to how the regular camera was fixed.
…an outdated, also reuse the same update code
…ght timestamp ros-simulation#408- appears to be working (though only looking at horizon) but getting these sdf errors: Error [SDF.cc:789] Missing element description for [pointCloudTopicName] Error [SDF.cc:789] Missing element description for [depthImageCameraInfoTopicName] Error [SDF.cc:789] Missing element description for [pointCloudCutoff]
…g 0.6 seconds to receive the messages (still well less than 2.0 seconds). Also all the tests can be run with run_tests_gazebo_plugins_rostest but only with the -j1 flag ros-simulation#409
fdb1895
to
9b56df9
Compare
I've made the tests disabled by default unless ENABLE_DISPLAY_TESTS is on, and rebased off the latest jade-devel. |
I haven't tried the tests myself, but we just independently ran into the same bug and chased down the same underlying fix (using |
see this related issue in the gazebo repo. I made similar changes to the openni_kinect plugin and the timestamp issue is fixed for me. |
<depthImageTopicName>depth/image_raw</depthImageTopicName> | ||
<!-- neither camera info is getting published, frame_id is empty | ||
in points and both image headers --> | ||
<depthImageTopicCameraInfoName>depth/camera_info</depthImageCameraInfoTopicName> |
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 ran into an xml parser error that turned out to be due to this line. There is a mismatch between open and end tags
had to make a minor fix for the depth camera test to run. After that, all tests passed for me
|
Thanks Ian for the testing. @lucasw if you please could apply the patch that Ian mentioned, it would be great so I can propagate the change to the different branches with the fix included. |
This PR builds on top of pull request #410 and applies the timestamp fix to kinect_openni and prosilica sensors
This PR builds on top of pull request ros-simulation#410 and applies the timestamp fix to kinect_openni and prosilica sensors
Fix for #408
The last measurement time is the time that gazebo generated the sensor data, so ought to be used.
The other cameras need similar fixes to have the proper timestamps.
There is a test to show that the timestamp is good, but issue #409 has lead me to comment it out for now.
There probably ought to be a separate issue about what updateRate is supposed to be for, and if it isn't useful remove it (from all the sensors that have it) in another PR.