Custom Ros 2 messages

@christianbarcelo I’m using Humble (python 3.10) in Ubuntu 22.04.

I recommend you to compile it using a docker image to avoid messing up your local python installation. I’m gonna use ackermann_msgs package as a reference:

# Run docker container with ROS2 Humble
docker pull osrf/ros:humble-desktop
docker run -it osrf/ros:humble-desktop

# Install Python 3.7
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.7

# Link Python 3.7 as default
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
sudo update-alternatives  --set python3 /usr/bin/python3.7

# Verify that the default python version is now 3.7
python3 --version

# Create a ros workspace
mkdir -p /ros2_ws/src
cd /ros2_ws/src

# Clone the pkg you want to compile, using ackermann_msgs repo as reference
git clone -b ros2 https://github.com/ros-drivers/ackermann_msgs.git

# Install distutils as is needed for colcon
sudo apt install python3.7-distutils

# Build the workspace
cd /ros2_ws
colcon build

This should build correctly for simple msg packages. However, I tried with moveit_msgs and because it has other dependencies I couldn’t resolve the issues.

You can move the build files to your local machine as follows:

# Get the DOCKER ID of the current image running
docker ps -alq

# Copy the build folder in the folder ~/python3.7_build of your local machine
docker cp DOCKERID:/ros2_ws/build/ackermann_msgs ~/python3.7_build

Then move the binary files (.so) into ~/.local/share/ov/pkg/isaac_sim-2022.2.1/exts/omni.isaac.ros2_bridge-humble/bin .

Finally, you should modify omni.add_on.ros2_bridge-humble/config/extension.toml as explained here. Although I’m stuck in this step.

@toni.sm mentioned the file ... __python.so which doens’t appear in my build. I only have ... __rosidl_generator_py.so under rosidl_generato_py/ackermann_msgs folder. I tried moving it also to /bin and to extension.toml but the package is not detected in python anyways.

I hope that helps. I finally opted to simplify the message sent to one recognized by ros isaac, but if you make it work, let me know!