Skip to content

malakalhanafi02/ros1_bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

🌉ROS1_bridge

The ros1_bridge package allows for communication between ROS1 and ROS2 systems. This task involves setting up the bridge to relay topics from ROS1 Noetic to ROS2 Foxy.


image

The image shows the following:

  1. Terminal 1: ROS1 nodes running and receiving messages from the ROS2 bridge.
  2. Terminal 2: ROS2 bridge running and handling the messages.
  3. Terminal 3: Publishing messages from ROS2 to ROS1.
  4. Terminal 4: Listening to the ROS1 topic and successfully echoing the messages published from ROS2.

  1. Install colcon:

    • Update your package index:
sudo apt update
  • Install colcon:
sudo apt install python3-colcon-common-extensions
  1. Create Workspaces for ROS Noetic and ROS2 Foxy:

ROS1:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
source devel/setup.bash

ROS2:

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/
colcon build
source install/local_setup.bash
  1. Install the Arduino Robot Arm Package in ROS Noetic:

    • Install moveit_ros_planning:
sudo apt-get install ros-noetic-moveit
  • Rebuild the Workspace (if encountered an error):
cd ~/catkin_ws
catkin_make
  • Install the Arduino Robot Arm Package:
cd ~/catkin_ws/src
git clone https://github.com/smart-methods/arduino_robot_arm.git
cd ..
catkin_make
source devel/setup.bash
  1. Create and Set Up ros1_bridge Workspace:
mkdir -p ~/ros1_bridge_ws/src
cd ~/ros1_bridge_ws/src
git clone -b foxy https://github.com/ros2/ros1_bridge.git
cd ~/ros1_bridge_ws
colcon build --packages-select ros1_bridge --cmake-force-configure --cmake-args -DBUILD_TESTING=FALSE
source install/local_setup.bash
  1. Source ROS1 and ROS2 Setup Files:

    • Ensure All Required ROS 2 Packages are Installed:
sudo apt update
sudo apt install ros-foxy-rmw-cyclonedds-cpp ros-foxy-rmw-fastrtps-cpp ros-foxy-rmw-implementation
  • Source ROS1 and ROS2
source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
source /opt/ros/foxy/setup.bash
source ~/ros2_ws/install/local_setup.bash
  • If error encountered:
  • Install python3-colcon-common-extensions and python3-ament-package:
sudo apt update
sudo apt install python3-colcon-common-extensions python3-ament-package
  • Rebuild the ros1_bridge:
cd ~/ros1_bridge_ws
colcon build --packages-select ros1_bridge --cmake-force-configure --cmake-args -DBUILD_TESTING=FALSE
image
  1. Test the bridge:
source install/local_setup.bash
ros2 run ros1_bridge dynamic_bridge --print-pairs
  1. Launch the Arduino_robot_arm package:
source /opt/ros/noetic/setup.bash
source ~/catkin_ws/devel/setup.bash
roslaunch robot_arm_pkg check_motors.launch
rostopic list
image

Running ros1_bridge

After launching the check_motors.launch file and have the robot arm running in ROS1, you need to set up the ros1_bridge and run it to ensure communication between ROS1 and ROS2.

Open a new terminal:

  1. Run the bridge:
source install/setup.bash
ros2 run ros1_bridge dynamic_bridge
  1. Echo /joint_states topic in ROS2:
source /opt/ros/foxy/setup.bash
ros2 topic echo /joint_states sensor_msgs/msg/JointState

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published