[Fawkes Git] branch/jrothe/realsense: 2 revs updated. (0.5.0-3086-g75260df)

Johannes Rothe johannes.rothe at rwth-aachen.de
Fri Aug 26 14:50:03 CEST 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, jrothe/realsense has been updated
        to  75260dfa9714ca23dbb232311d076e18b1c63838 (commit)
       via  8ddee72475be2b245b2e6c48350cb528a95e4289 (commit)
      from  35194eb6ae5982d9218b5492f9fabe983ec299de (commit)

http://git.fawkesrobotics.org/fawkes.git/jrothe/realsense

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 8ddee72475be2b245b2e6c48350cb528a95e4289
Author:     Johannes Rothe <johannes.rothe at rwth-aachen.de>
AuthorDate: Mon Jun 27 19:59:19 2016 +0200
Commit:     Johannes Rothe <johannes.rothe at rwth-aachen.de>
CommitDate: Mon Jun 27 19:59:19 2016 +0200

    realsense: add config value to set the laser power

http://git.fawkesrobotics.org/fawkes.git/commit/8ddee72
http://trac.fawkesrobotics.org/changeset/8ddee72

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 75260dfa9714ca23dbb232311d076e18b1c63838
Author:     Johannes Rothe <johannes.rothe at rwth-aachen.de>
AuthorDate: Fri Aug 26 14:48:39 2016 +0200
Commit:     Johannes Rothe <johannes.rothe at rwth-aachen.de>
CommitDate: Fri Aug 26 14:48:39 2016 +0200

    realsense: omit the plugin if librealsense isn't found

http://git.fawkesrobotics.org/fawkes.git/commit/75260df
http://trac.fawkesrobotics.org/changeset/75260df

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 cfg/conf.d/realsense.yaml                  |    5 +++++
 src/plugins/realsense/Makefile             |   15 +++++++++++++--
 src/plugins/realsense/realsense_thread.cpp |    9 +++++++--
 src/plugins/realsense/realsense_thread.h   |    1 +
 4 files changed, 26 insertions(+), 4 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 8ddee72475be2b245b2e6c48350cb528a95e4289 - - - - - - - - - -
Author:  Johannes Rothe <johannes.rothe at rwth-aachen.de>
Date:    Mon Jun 27 19:59:19 2016 +0200
Subject: realsense: add config value to set the laser power

 cfg/conf.d/realsense.yaml                  |    5 +++++
 src/plugins/realsense/realsense_thread.cpp |    9 +++++++--
 src/plugins/realsense/realsense_thread.h   |    1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/cfg/conf.d/realsense.yaml b/cfg/conf.d/realsense.yaml
index 0a5f668..8834aee 100644
--- a/cfg/conf.d/realsense.yaml
+++ b/cfg/conf.d/realsense.yaml
@@ -9,3 +9,8 @@ realsense:
 
   # ID of the PointCloud
   pcl_id: "/camera/depth/points"
+
+  # Section to set the Realsense device options
+  device_options:
+    # Laser power from 0 - 15 as integer
+    laser_power: 15
diff --git a/src/plugins/realsense/realsense_thread.cpp b/src/plugins/realsense/realsense_thread.cpp
index 4126d71..bdbeb6a 100644
--- a/src/plugins/realsense/realsense_thread.cpp
+++ b/src/plugins/realsense/realsense_thread.cpp
@@ -44,9 +44,11 @@ RealsenseThread::init()
   const std::string cfg_prefix = "/realsense/";
   frame_id_ = config->get_string(cfg_prefix + "frame_id");
   pcl_id_ = config->get_string(cfg_prefix + "pcl_id");
+  laser_power_ = config->get_int(cfg_prefix + "device_options/laser_power");
 
   rs_stream_type_ = RS_STREAM_DEPTH;
   connect_and_start_camera();
+
   camera_scale_ = rs_get_device_depth_scale(rs_device_, NULL);
 
   rs_get_stream_intrinsics(rs_device_, rs_stream_type_, &z_intrinsic_, &rs_error_);
@@ -108,6 +110,7 @@ bool
 RealsenseThread::connect_and_start_camera()
 {
   rs_context_ = rs_create_context(RS_API_VERSION, &rs_error_);
+  log_error();
   num_of_cameras_ = rs_get_device_count(rs_context_, &rs_error_);
   logger->log_info(name(), "No. of cameras: %i ", num_of_cameras_);
   if (num_of_cameras_ < 1){
@@ -115,14 +118,16 @@ RealsenseThread::connect_and_start_camera()
   }
 
   rs_device_ = get_camera();
-
+  rs_set_device_option(rs_device_, RS_OPTION_F200_LASER_POWER, laser_power_, &rs_error_);
+  log_error();
   enable_depth_stream();
 
   rs_start_device(rs_device_, &rs_error_);
+  log_error();
 
   logger->log_info(name(), "Stream format: %s",
                    rs_format_to_string(rs_get_stream_format(rs_device_, rs_stream_type_, &rs_error_)));
-  log_error();
+
   camera_started_ = true;
   return true;
 }
diff --git a/src/plugins/realsense/realsense_thread.h b/src/plugins/realsense/realsense_thread.h
index 5b5f999..1a53979 100644
--- a/src/plugins/realsense/realsense_thread.h
+++ b/src/plugins/realsense/realsense_thread.h
@@ -89,6 +89,7 @@ class RealsenseThread
   std::string frame_id_;
   std::string pcl_id_;
   bool camera_started_ = false;
+  int laser_power_;
 
 };
 

- *commit* 75260dfa9714ca23dbb232311d076e18b1c63838 - - - - - - - - - -
Author:  Johannes Rothe <johannes.rothe at rwth-aachen.de>
Date:    Fri Aug 26 14:48:39 2016 +0200
Subject: realsense: omit the plugin if librealsense isn't found

 src/plugins/realsense/Makefile |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/realsense/Makefile b/src/plugins/realsense/Makefile
index f9faeb7..ea16f0a 100644
--- a/src/plugins/realsense/Makefile
+++ b/src/plugins/realsense/Makefile
@@ -23,15 +23,26 @@ CFLAGS += $(CFLAGS_CPP11)
 CFLAGS  += $(CFLAGS_TF) $(CFLAGS_PCL) $(CFFLAGS_conveyor_pose)
 LDFLAGS += $(LDFLAGS_TF) $(LDFLAGS_PCL)
 
-
 LIBS_realsense = m fawkescore fawkesutils fawkesaspects fawkesbaseapp \
                       fawkesblackboard fawkesinterface realsense usb-1.0 \
                       fawkespcl_utils
 
 OBJS_realsense = realsense_plugin.o realsense_thread.o 
 
-PLUGINS_all = $(PLUGINDIR)/realsense.$(SOEXT)
+ifneq ($(wildcard $(SYSROOT)/usr/local/lib/librealsense.so),)
+	PLUGINS_all = $(PLUGINDIR)/realsense.$(SOEXT)
+else
+	WARN_TARGETS += warning_librealsense
+endif
 
 OBJS_all = $(OBJS_realsense)
 
+ifeq ($(OBJSSUBMAKE),1)
+all: $(WARN_TARGETS)
+
+.PHONY: warning_nolibrealsense
+warning_librealsense:
+	$(SILENT)echo -e "$(INDENT_PRINT)--> $(TRED)Omitting Realsense Plugin$(TNORMAL) (librealsense not found)"
+endif
+
 include $(BUILDSYSDIR)/base.mk
\ No newline at end of file




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list