Unable to view some ROS1 messages using ROS bridge
I am currently working inside a Docker container that is running on a Husky robot. The Husky is running Ubuntu 18.04 and uses ROS Melodic. I am using the ROS bridge docker container (Dockerfile) to try to access the Husky's messages from ROS2.
I create the container with:
$ docker run -dt --name foxy-ros-bridge --network="host" --restart unless-stopped osrf/ros:foxy-ros1-bridge
I enter the container with docker exec -it foxy-ros-bridge bash
.
If I source the ROS1 workspace with ROS1, I can see the topics being published to from the Husky:
root@cpr-mic09:/# source /opt/ros/noetic/setup.bash
ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
root@cpr-mic09:/# rostopic list
/cmd_vel
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state
/e_stop
/husky_velocity_controller/cmd_vel
/husky_velocity_controller/odom
/husky_velocity_controller/parameter_descriptions
/husky_velocity_controller/parameter_updates
However, if I try to see the topics visible with ROS2, I get:
root@cpr-mic09:/# source /opt/ros/foxy/setup.bash
ROS_DISTRO was set to 'noetic' before. Please make sure that the environment does not mix paths from different distributions.
root@cpr-mic09:/# ros2 topic list
/parameter_events
/rosout
I then tried to use the ROS bridge (following these steps):
$ mkdir -p ~/ros2_workspace/src
$ cd ~/ros2_workspace/src
$ git clone --single-branch --branch foxy https://github.com/ros2/ros1_bridge ros1_bridge
$ cd ~/ros2_workspace/
# ros2_workspace/src now only contains ros1_bridge, so the following command does nothing
$ colcon build --symlink-install --packages-skip ros1_bridge
$ source /opt/ros/noetic/setup.bash
$ source /opt/ros/foxy/setup.bash
$ colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure --event-handlers console_direct+
The package is built successfully, but none of the Husky topics show up:
root@cpr-mic09:/ros2_workspace# ros2 run ros1_bridge dynamic_bridge
Created 2 to 1 bridge for service /diagnostics_agg/add_diagnostics
Created 2 to 1 bridge for service /ekf_localization/enable
[ERROR] [1611353094.017087460]: Tried to advertise on topic [/rosout] with latch=0 but the topic is already advertised with latch=1
created 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'
I'm not sure what else I need to do in order to make the Husky's topics available to ROS2. One thing I was considering is that Husky isn't installed in the ROS1 workspace (although the topics are viewable). I was thinking I might need to install it, but ros-melodic-husky-desktop
can't be installed on Ubuntu 20.02 and ros-noetic-husky-desktop
doesn't exist.
I would really appreciate any advice on this issue
Update
I tried seeing what would happen if I build the Husky package from source, so I did:
mkdir -p ~/ros1_workspace/src
cd ~/ros1_workspace/src
source /opt/ros/noetic/setup.bash
git clone https://github.com/husky/husky.git
cd husky
git checkout noetic-devel
cd ~/ros1_workspace
catkin_make
but then I get the error:
-- Could NOT find controller_manager (missing: controller_manager_DIR)
-- Could not find the required component 'controller_manager'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros ...