microsoft / ros_azure_iothub

This repository contains a ROS node for bidirectional communication with IoT Hub
38 stars 30 forks source link

Install failing with ROS Melodic #41

Open shmpwk opened 3 years ago

shmpwk commented 3 years ago

Thank you for your interesting work!

I'm trying the How to Build (Ubuntu Linux Melodic install).

My environment is ubuntu18.04 on WSL2 and ROS Melodic.

I have an error when installing system dependencies like

$ rosdep install --from-paths src --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
roscpp_azure_iothub: Cannot locate rosdep definition for [libazure-iot-sdk-c]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully

As a result, I failed to catkin_make

$ catkin_make install
Base path: /home/shmpwk/catkin_ws
Source space: /home/shmpwk/catkin_ws/src
Build space: /home/shmpwk/catkin_ws/build
Devel space: /home/shmpwk/catkin_ws/devel
Install space: /home/shmpwk/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/shmpwk/catkin_ws/build"
####
####
#### Running command: "make install -j8 -l8" in "/home/shmpwk/catkin_ws/build"
####
[ 20%] Built target dynamic_tutorials_gencfg
[ 40%] Building CXX object ros_azure_iothub/roscpp_azure_iothub/CMakeFiles/roscpp_azure_iothub_node.dir/src/ros_azure_iothub_cpp_node.cpp.o
Scanning dependencies of target dynamic_tutorials_node
[ 60%] Building CXX object ros_azure_iothub/dynamic_tutorials/CMakeFiles/dynamic_tutorials_node.dir/src/server.cpp.o
/home/shmpwk/catkin_ws/src/ros_azure_iothub/roscpp_azure_iothub/src/ros_azure_iothub_cpp_node.cpp:14:10: fatal error: azure_c_shared_utility/threadapi.h: No such file or directory
 #include <azure_c_shared_utility/threadapi.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ros_azure_iothub/roscpp_azure_iothub/CMakeFiles/roscpp_azure_iothub_node.dir/build.make:62: recipe for target 'ros_azure_iothub/roscpp_azure_iothub/CMakeFiles/roscpp_azure_iothub_node.dir/src/ros_azure_iothub_cpp_node.cpp.o' failed
make[2]: *** [ros_azure_iothub/roscpp_azure_iothub/CMakeFiles/roscpp_azure_iothub_node.dir/src/ros_azure_iothub_cpp_node.cpp.o] Error 1
CMakeFiles/Makefile2:1350: recipe for target 'ros_azure_iothub/roscpp_azure_iothub/CMakeFiles/roscpp_azure_iothub_node.dir/all' failed
make[1]: *** [ros_azure_iothub/roscpp_azure_iothub/CMakeFiles/roscpp_azure_iothub_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 80%] Linking CXX executable /home/shmpwk/catkin_ws/devel/lib/dynamic_tutorials/dynamic_tutorials_node
[ 80%] Built target dynamic_tutorials_node
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make install -j8 -l8" failed
Timple commented 3 years ago

This is because the dependency is listed as libazure-iot-sdk-c source While it is registered in rosdep as azure-iot-sdk-c source

Perhaps it's possible to change the entry in the package.xml?

In the meantime you can manually apt install ros-melodic-azure-iot-sdk-c

Disclaimer: not a maintainer here, but I released the azure-iot-sdk-c to the ROS buildfarm because it takes ages to compile.

shmpwk commented 3 years ago

Thank you for your quick response! You are right, and it is solved!!!

by

sudo apt install ros-melodic-azure-iot-sdk-c

and edit package.xml from

<?xml version="1.0"?>
<package format="2">
  <name>roscpp_azure_iothub</name>
  <version>0.0.1</version>
  <description>
  This package interfaces with Azure IoT Hub to provide cloud-based device management and command and control services over Azure IoT C99 SDK.
  </description>

  <maintainer email="vtam@microsoft.com">Vincent Tam</maintainer>
  <maintainer email="seanyen@microsoft.com">Sean Yen</maintainer>
  <url type="website">https://github.com/Microsoft/ros_azure_iothub</url>
  <author>Vincent Tam</author>
  <license>MIT</license>

  <buildtool_depend>catkin</buildtool_depend>

  <depend>dynamic_reconfigure</depend>
  <depend>roscpp</depend>
  <depend>std_msgs</depend>
  <depend>topic_tools</depend>
  <depend>ros_type_introspection</depend>
  <depend>libazure-iot-sdk-c</depend>
  <test_depend>rosunit</test_depend>
</package>

to

<?xml version="1.0"?>
<package format="2">
  <name>roscpp_azure_iothub</name>
  <version>0.0.1</version>
  <description>
  This package interfaces with Azure IoT Hub to provide cloud-based device management and command and control services over Azure IoT C99 SDK.
  </description>

  <maintainer email="vtam@microsoft.com">Vincent Tam</maintainer>
  <maintainer email="seanyen@microsoft.com">Sean Yen</maintainer>
  <url type="website">https://github.com/Microsoft/ros_azure_iothub</url>
  <author>Vincent Tam</author>
  <license>MIT</license>

  <buildtool_depend>catkin</buildtool_depend>

  <depend>dynamic_reconfigure</depend>
  <depend>roscpp</depend>
  <depend>std_msgs</depend>
  <depend>topic_tools</depend>
  <depend>ros_type_introspection</depend>
  <depend>azure-iot-sdk-c</depend>
  <test_depend>rosunit</test_depend>
</package>

Finally,

$ rosdep install --from-paths src --ignore-src -r -y
#All required rosdeps installed successfully

P.S. I've tried source build but it makes the problem more complicated, but ros-melodic-azure-iot-sdk-c really helped me.

Timple commented 3 years ago

Can you leave the issue open? It is probably still valid for other users.