Skip to content
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

Start IMU in startCamera #175

Merged
merged 4 commits into from Dec 21, 2016
Merged

Conversation

mkhansenbot
Copy link

Please ensure the above guidelines for contributing are met.

Fixes Issue: #

Changes proposed in this pull request:

  • This fixes the try_for_lock timeout error that sometimes occurs for ZR300 on some systems
  • It changes the way the IMU is started for ZR300 to start IMU and streams using device->start(rs_source::RS_SOURCE_ALL)
  • This removes the call to rs_start_source(...) for the IMU
  • Doing so also aligns the camera and IMU timestamps

@@ -723,8 +723,7 @@ namespace realsense_camera
ROS_INFO_STREAM(nodelet_name_ << " - Starting camera");
// Set up the callbacks for each stream
setFrameCallbacks();
rs_start_device(rs_device_, &rs_error_);
checkError();
rs_device_->start(rs_source_);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only C++ style realsense call we are making. Was there no C api for this?
If this throws an exception (during start/stop power service), do we catch it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll add a try-catch.

rs_enable_motion_tracking_cpp(rs_device_, new rs::motion_callback(motion_handler_),
new rs::timestamp_callback(timestamp_handler_), &rs_error_);
checkError();
rs_source_ = RS_SOURCE_ALL; // overrides default to enable motion tracking
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to have "at least two" spaces before an End of Line comment.
realsense/realsense_camera/src/zr300_nodelet.cpp:572: At least two spaces is best between code and comments [whitespace/comments] [2]

@mkhansenbot
Copy link
Author

Added try-catch and fixed the roslint error, please review again

Copy link

@mdhorn mdhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link

@mdhorn mdhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roslint now showing the use of tabs

@mdhorn
Copy link

mdhorn commented Dec 21, 2016

@mkhansen-intel
to check roslint before submitting
catkin_make roslint_realsense_camera

@mkhansenbot
Copy link
Author

OK, now that I know how to run roslint I fixed the issues

@mdhorn mdhorn merged commit 74d32f1 into IntelRealSense:indigo-devel Dec 21, 2016
@mdhorn
Copy link

mdhorn commented Dec 21, 2016

@mkhansen-intel Sorry, I missed the merge-squash and only did a merge. 👎
I think we are stuck with the history now or the PR's won't match up.

mdhorn added a commit to mdhorn/realsense that referenced this pull request Dec 21, 2016
Refactoring PR IntelRealSense#175 broke the logic for disabling IMU
jonpol01 added a commit to jonpol01/realsense that referenced this pull request Apr 17, 2017
* Don't ignore linker flags set by user

Yocto's bitbake sets global LDFLAGS that include the option
--hash-style=gnu. If this option is ignored then bitbake's
QA checks report that

QA Issue: No GNU_HASH in the elf binary: '/[...]/opt/ros/indigo/lib/librealsense_camera_nodelet.so' [ldflags]

The patch includes user defined linker flags to
CMAKE_SHARED_LINKER_FLAGS defined in the project's CMakeList.txt.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>

* Make system wrapper function generic

Error message was assume only use was dynamic reconfigure

Added boost as ROS dependency -- should have already been required.

* Added imu_start_ts for imu sync

* Added frame callbacks instead of rs_wait_for_frames

* Added imu_mutex for data sync to callback

* Refactored setStreams

* Removed prepareTopics thread; replaced with setDepthEnable

* Changed depth_scale_meters to local var

* Renamed getStreamData to setImageData

* Change color stream default to 30fps

Improve reliability of the camera by reducing the color stream
to 30fps by default. This will be the highest frame rate which will
be validate with VGA or higher resolutions for use with ROS.

Default files will no longer use the librealsense preset modes
as they will be depreciated in the future.

* Fixed boost mutex error when destroying ZR300 nodelet

Replaced boost::mutex with std::mutex

* Added destructor to ZR300 nodelet to join thread

* Fix F200/SR300 tests for new default 30fps

The F200 and SR300 tests were attempting too much code reuse
by include the r200_nodelet_default.launch file.
When the Default launch files were changed to set 30fps as the new
default for the color stream, F200/SR300 also had to set new defaults
for the Depth stream to prevent using the invalid R200 depth default.
The R200 default file does NOT pass the depth_width and depth_height
to the nodelet so the override values were lost.

* Add Dynamic Transforms support -- multi-cam

Due to a ROS bug which prevents publishing more than one static
transform in separate processes, enable the use of dynamic
camera transforms when needed for multiple camera support.

Static transforms are still the default.

See:
  ros/ros_comm#146
  ros/geometry2#181

* Code Review Fixes

* Enable ROS Lint

Many minor fixes to be compliant with ROS Lint standards.

* C++11 Flagged ROS Lint items

Suppressing these for now, but should be investigated as
they are not compliant with current ROS standards.

* Update Change log for release

* 1.7.0

* Update RGBD launch files.

Modify the r200/sr300 RGBD-style launch files
to no longer use the RGBD depth/ir/rgb_processing
flags to control whether the corresponding stream
is also enabled. For example, now turning off
RGBD depth *processing* will no longer disable
the depth stream itself.

* Do not register IR callback if stream disabled

Work around bug in librealsense where the callback for
IR is called even if the stream is disabled if IR2 stream
is enabled.
See IntelRealSense/librealsense#393

* Start IMU in startCamera

* Fix Multi-cam example launch file

Leading '/' required to ensure both cameras use the same
nodelet manager due to group name space.

* Added try-catch for start and stop device

* Fixed spacing before comment - roslint failure

* Disable Fisheye and IMU on ZR300 for RGBD launch

* Fixed roslint tabs errors

* Allow Disabling of IMU after PR#175

Refactoring PR IntelRealSense#175 broke the logic for disabling IMU

* Updated Change Log for 1.7.0

* Added retry in tests to avoid random failures

* Also exclude swap files from Git

* Use shared timestamp for SR300/F200 cameras

Due to camera hardware issues on the SR300 and F200, reverted back
to using a common timestamp updated by the fastest stream. This was the
old behaviour when rs_wait_for_frames was used prior to release 1.7.0.

* Generate Warning for non-validated camera firmware

Compare the camera's firmware version to the validated firmware version. Log
a warn message if the two firmware versions do not match. If the camera is
ZR300, also check the adapter firmware version and the motion module firmware
version.

* Updated Change Log for 1.7.1

* 1.7.1

* Git ignore QT Creator *.workspace files

* Upload 18 bat tests

Upload first version of stable bat tests, there are 2 common tests
to check librealsense and realsense_camera installed, and there are
4 specific tests of each camera (R200/F200/SR300/ZR300) to check
camera info matrix, enabled tf, set power off/on and force power
off/on, totally 18 tests.

All the tests are based on rospy, using python script as test type.

* Changed fisheye_strobe and fisheye_external_trigger to static params

* Change tf to using setRPY for consistency

* Create tool to get debug info

Create a node tool that, when run, will display the user's
operating system, kernel, ROS version, RealSense version, librealsense
version, and the type and firmware of any detected cameras.

* Fix minor spelling errors

* Updated the maintainers

* Update change log

* 1.7.2

* Added SyncNodelet class

* Updated F200 to be based on SyncNodelet

* Updated SR300 to be based on SyncNodelet

* Fixed roslint errors

* Removed getTimestamp override from F200 and SR300

* Updated r200 to be based on SyncNodelet

* Added loop checking of start/stop camera

* Update Debug Tool

Update debug tool to show motion module and adapter firmwares for the
ZR300 camera.

Update the validated firmware versions.

* Added check for depth_enable dynamic change

* Dynamic reconfigure of SR300 exposure controls

* Updated Copyright to 2017

* Added SyncNodelet destructor

* Added blank lines for readability after closing braces

* Fixed LR auto exposure issue IntelRealSense#131

LR gain should be set only when LR auto exposure is disabled

* Add option to link against non-catkin librealsense

In OpenEmbedded setups where both meta-ros and
meta-intel-realsense layers are used it's problematic
to avoid two copies of librealsense installed onto
an embedded target: one catkit-based installed under
/opt/ros and one other installed to a standard system
location.

This patch adds an option making realsense_camera link
against librealsense provided by the host system.

By default the currently existing behavior is preserved.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>

* Enable roslint when CATKIN_ENABLE_TESTING is True

roslint depends on catkin_run_tests_target() which is defined only
when CATKIN_ENABLE_TESTING is True.

Thus run roslint functions in CMakeLists.txt only when testing
is enabled.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>

* Exposed autoexposure toggle and exposure control for F200, R200. Updated copyright data on nodelets

* Fix build timing issue for catkin

* Make ZR300 consistent with other cameras

Recent color auto exposure code changes are slightly different
for SR300/F200/R200 from ZR300. Mainly the ZR300 needed the same
if condition added for only setting the manual value when auto
exposure is disabled.

* Updated changelog

* 1.8.0

* Enable configuration of the TF publication rate when using tf_dynamic

The parameter is called tf_publication_rate

* 1.8.0 -- Updated

* librealsense: Fix link when the system library is used

Otherwise librealsense won't be listed as a dependency for the nodelet
that will fail to load due to undefined symbols.

Signed-off-by: Murilo Belluzzo <murilo.belluzzo@intel.com>

* Add RGDB launch file for the ZR300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants