microsoft / ros_azure_iothub

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

Instructions failing for ROS noetic #36

Open Timple opened 3 years ago

Timple commented 3 years ago

In the readme ROS noetic is used (linux instructions). But the ppa for focal is not working.

ooeygui commented 3 years ago

Hi @timple, I'd love to know more about how you are intending to use this ROS node. Is there anything you can share? Sorry about that - I was a little over zealous when changing the docs over. The Azure IoT SDK currently doesn't support 20.04, so it won't currently work on noetic.

ooeygui commented 3 years ago

I changed the doc to reflect this scenario. However, we do want to support noetic when the iot sdk supports 20.04

Timple commented 3 years ago

Well, since it's all Microsoft. Any chance you can give your colleagues a nudge? 😉

ooeygui commented 3 years ago

:-) Yes, this is an ongoing conversation. I'd love to connect with you to discuss how you are using this ROS node, feel free to reach out to me - https://www.linkedin.com/in/louamadio/

Timple commented 3 years ago

Thanks for the quick replies! We're still in the investigating phase. I only stumbled upon this package after figuring out that the sdk doesn't have a 20.04 target. So I was curious how this package solved that, but unfortunately it doesn't.

I know catkin can compile standard cmake targets. So something like this should be possible I guess?

Dockerfile:

FROM ros:noetic-robot
RUN apt-get update -qq && apt-get install -qqy python3-catkin-tools python3-osrf-pycommon git

# Install azure-iot-sdk-c
RUN git clone https://github.com/Azure/azure-iot-sdk-c.git src/azure-iot-sdk-c
RUN git -C src/azure-iot-sdk-c submodule update --init
COPY azure-iot-sdk-c-package.xml src/azure-iot-sdk-c/package.xml
# Maybe this:?
# RUN bash -c 'source /opt/ros/noetic/setup.bash && catkin config --append-args -Dbuild_as_dynamic=ON'

# Copy harvey_msgs as dependency (default to master branch if unspecified)
RUN git clone https://github.com/microsoft/ros_azure_iothub.git src/ros_azure_iothub

# Install dependencies used by packages
RUN rosdep update && rosdep install -y -i --from-paths src

# Compile ROS package
RUN bash -c 'source /opt/ros/noetic/setup.bash && catkin build'

azure-iot-sdk-c-package.xml:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
  <name>libazure-iot-sdk-c</name>
  <version>1.2021.1</version>
  <description>Azure IoT C SDKs and Libraries</description>

  <maintainer email="opencode@microsoft.com"></maintainer>
  <license>MIT</license>

  <buildtool_depend>cmake</buildtool_depend>
  <depend>curl</depend>

  <export>
    <build_type>cmake</build_type>
  </export>
</package>
ooeygui commented 3 years ago

The Azure IoT SDK team recommended that for 20.04 it be built from source and installs it into the local image.

To support another project, we did the following from our Azure DevOps pipeline:

      source /opt/ros/melodic/setup.bash \
      && sudo apt-get update \
      && sudo apt-get install -y git cmake build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev \
      && git clone https://github.com/Azure/azure-iot-sdk-c.git \
      && cd azure-iot-sdk-c/ \
      && git submodule update --init \
      && mkdir cmake \
      && cd cmake \
      && cmake .. \
      && cmake --build . \
      && sudo make install \

Which builds the sdk and installs it. It's not really catkin friendly, I'll look into adapting this to the noetic branch.

Timple commented 3 years ago

Ah yes, that would be the obvious way to do it. But these steps need to be repeated in every CI build, on every robot and all user pcs. And for ROS and apt packages there are systems in place to resolve these issues. Thus reducing the maintenance burden. That's why a ppa release or a catkin build would be preferable 🙂