From 51b3089d243b90f0616788c33409b7ca67876ee3 Mon Sep 17 00:00:00 2001 From: Dominick Vanthienen Date: Tue, 16 May 2017 16:00:06 +0200 Subject: [PATCH 1/6] install sdk build tools 25.0.2+3 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f386f3..12166cc 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ In this file, write the path to your Android SDK and NDK in the following way e. ndk.dir=/opt/android-ndk-r10b sdk.dir=/opt/android-sdk-linux ``` +If you haven't installed the SDK and NDK already, follow the instructions in section 'Building the app with Android Studio'. Install catkin tools if necessary. ``` @@ -88,6 +89,7 @@ Build the app and generate its .apk file. ``` catkin build --no-jobserver ``` +or use Android Studio to build (and install). Plug your device to your desktop and install the app on your device using [adb](http://developer.android.com/studio/command-line/adb.html). ``` @@ -136,7 +138,7 @@ source ~/tango_ros_ws/devel/setup.bash studio.sh ``` -After launch, open the Configure -- SDK Manager. From SDK Platforms, install Android 4.4 and 5.1 (API level 19 + 22). From SDK Tools, install `NDK` and `Android SDK Build-Tools 21.1.2`. +After launch, open the Configure -- SDK Manager. From SDK Platforms, install Android 4.4 and 5.1 (API level 19 + 22). From SDK Tools, install `NDK` and `Android SDK Build-Tools 21.1.2 + 25.0.2 + 25.0.3`. Now extend your PATH variable so that ```ndk-build``` can be executed: ``` From 8cd533206c96564a2c5a133d63b5c4c9fad68f03 Mon Sep 17 00:00:00 2001 From: Dominick Vanthienen Date: Tue, 16 May 2017 17:30:56 +0200 Subject: [PATCH 2/6] force gradle version and explain usage of java 8 --- README.md | 6 ++++++ TangoRosStreamer/build.gradle | 4 +++- TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f386f3..e169611 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,12 @@ sudo apt-get update sudo apt-get install openjdk-7-jdk echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/" >> ~/.bashrc ``` +In case the build insists of using Java 8 when using Ubuntu 14.04, +check and point to the version installed by android-studio: +``` +cat /opt/android-studio/jre/release +echo "export JAVA_HOME=/opt/android-studio/jre/" >> ~/.bashrc +``` Subsequently, download Android Studio from [here](https://developer.android.com/studio/index.html) and unzip (for example) to /opt/android-studio: diff --git a/TangoRosStreamer/build.gradle b/TangoRosStreamer/build.gradle index 8b0f2d1..4a28a5c 100644 --- a/TangoRosStreamer/build.gradle +++ b/TangoRosStreamer/build.gradle @@ -5,7 +5,9 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath('com.android.tools.build:gradle:2.1.2') { + force = true + } // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties b/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties index 3710617..9851e51 100644 --- a/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties +++ b/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip From 16da1cc8559c796b925945e0cdb694d9530ed650 Mon Sep 17 00:00:00 2001 From: Dominick Vanthienen Date: Tue, 16 May 2017 18:23:14 +0200 Subject: [PATCH 3/6] required update for higher android versions --- TangoRosStreamer/build.gradle | 2 +- TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TangoRosStreamer/build.gradle b/TangoRosStreamer/build.gradle index 4a28a5c..92bb9e0 100644 --- a/TangoRosStreamer/build.gradle +++ b/TangoRosStreamer/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath('com.android.tools.build:gradle:2.1.2') { + classpath('com.android.tools.build:gradle:2.3.2') { force = true } diff --git a/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties b/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties index 9851e51..3710617 100644 --- a/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties +++ b/TangoRosStreamer/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip From 573afc0b65aa07ba4a24b7fdb3ea62d4f7571899 Mon Sep 17 00:00:00 2001 From: Perrine Aguiar Date: Tue, 30 May 2017 15:18:50 +0200 Subject: [PATCH 4/6] Advertise depth and color topics only if camera enable --- .../tango_ros_native/src/tango_ros_node.cpp | 55 +++++++++++++------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/tango_ros_common/tango_ros_native/src/tango_ros_node.cpp b/tango_ros_common/tango_ros_native/src/tango_ros_node.cpp index 10b58cb..fb00fcc 100644 --- a/tango_ros_common/tango_ros_native/src/tango_ros_node.cpp +++ b/tango_ros_common/tango_ros_native/src/tango_ros_node.cpp @@ -166,12 +166,6 @@ void TangoRosNode::onInit() { area_description_T_start_of_service_publisher_ = node_handle_.advertise( AREA_DESCRIPTION_T_START_OF_SERVICE_TOPIC_NAME, queue_size, latching); - point_cloud_publisher_ = - node_handle_.advertise( - POINT_CLOUD_TOPIC_NAME, queue_size, latching); - laser_scan_publisher_ = - node_handle_.advertise( - LASER_SCAN_TOPIC_NAME, queue_size, latching); image_transport_.reset(new image_transport::ImageTransport(node_handle_)); try { @@ -181,20 +175,10 @@ void TangoRosNode::onInit() { fisheye_rectified_image_publisher_ = image_transport_->advertise(FISHEYE_RECTIFIED_IMAGE_TOPIC_NAME, queue_size, latching); - color_camera_publisher_ = - image_transport_->advertiseCamera(COLOR_IMAGE_TOPIC_NAME, - queue_size, latching); - color_rectified_image_publisher_ = - image_transport_->advertise(COLOR_RECTIFIED_IMAGE_TOPIC_NAME, - queue_size, latching); } catch (const image_transport::Exception& e) { - LOG(ERROR) << "Error while creating image transport publishers" << e.what(); + LOG(ERROR) << "Error while creating fisheye image transport publishers" << e.what(); } - mesh_marker_publisher_ = - node_handle_.advertise( - COLOR_MESH_TOPIC_NAME, queue_size, latching); - get_map_name_service_ = node_handle_.advertiseService(GET_MAP_NAME_SERVICE_NAME, boost::bind(&TangoRosNode::GetMapName, this, _1, _2)); @@ -252,6 +236,43 @@ TangoRosNode::~TangoRosNode() { } TangoErrorType TangoRosNode::OnTangoServiceConnected() { + const uint32_t queue_size = 1; + const bool latching = true; + // Advertise depth and color cameras topic only if they are enable. + if (enable_depth_) { + point_cloud_publisher_ = + node_handle_.advertise( + POINT_CLOUD_TOPIC_NAME, queue_size, latching); + laser_scan_publisher_ = + node_handle_.advertise( + LASER_SCAN_TOPIC_NAME, queue_size, latching); + } else { + point_cloud_publisher_.shutdown(); + laser_scan_publisher_.shutdown(); + } + if (enable_color_camera_) { + try { + color_camera_publisher_ = + image_transport_->advertiseCamera(COLOR_IMAGE_TOPIC_NAME, + queue_size, latching); + color_rectified_image_publisher_ = + image_transport_->advertise(COLOR_RECTIFIED_IMAGE_TOPIC_NAME, + queue_size, latching); + } catch (const image_transport::Exception& e) { + LOG(ERROR) << "Error while creating color image transport publishers" << e.what(); + } + } else { + color_camera_publisher_.shutdown(); + color_rectified_image_publisher_.shutdown(); + } + if (enable_depth_ && enable_color_camera_) { + mesh_marker_publisher_ = + node_handle_.advertise( + COLOR_MESH_TOPIC_NAME, queue_size, latching); + } else { + mesh_marker_publisher_.shutdown(); + } + TangoCoordinateFramePair pair; pair.base = TANGO_COORDINATE_FRAME_START_OF_SERVICE; pair.target = TANGO_COORDINATE_FRAME_DEVICE; From 01bc92a16d5e67505fde33916d89f9488ce0c96c Mon Sep 17 00:00:00 2001 From: Perrine Aguiar Date: Tue, 20 Jun 2017 10:36:37 +0200 Subject: [PATCH 5/6] Add link to section --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 12166cc..76f6efa 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ In this file, write the path to your Android SDK and NDK in the following way e. ndk.dir=/opt/android-ndk-r10b sdk.dir=/opt/android-sdk-linux ``` -If you haven't installed the SDK and NDK already, follow the instructions in section 'Building the app with Android Studio'. +If you haven't installed the SDK and NDK already, follow the instructions in section [Developing with Android Studio](#developing-with-android-studio). Install catkin tools if necessary. ``` @@ -89,7 +89,6 @@ Build the app and generate its .apk file. ``` catkin build --no-jobserver ``` -or use Android Studio to build (and install). Plug your device to your desktop and install the app on your device using [adb](http://developer.android.com/studio/command-line/adb.html). ``` From 723d61a7ee26d2debd9da908cab88db65e753859 Mon Sep 17 00:00:00 2001 From: Perrine Aguiar Date: Tue, 20 Jun 2017 10:54:27 +0200 Subject: [PATCH 6/6] Add doc comment --- TangoRosStreamer/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/TangoRosStreamer/build.gradle b/TangoRosStreamer/build.gradle index 92bb9e0..1331df9 100644 --- a/TangoRosStreamer/build.gradle +++ b/TangoRosStreamer/build.gradle @@ -6,6 +6,7 @@ buildscript { } dependencies { classpath('com.android.tools.build:gradle:2.3.2') { + // In case of versions conflict version above wins. force = true }