Skip to content

GITAM-MURTI-SDVLab/ROS2-TL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

ROS2-TL

For Teaching and Learning ROS2

Installation of available sensors in ROS2 Humble

1 🧭 Xsens MTi IMU Sensor

This guide provides a clear and concise setup for integrating an Xsens MTi IMU sensor with ROS 2 Humble using the xsens_mti_ros2_driver package. It includes installation steps, configuration, usage instructions, and troubleshooting tips based on real-world debugging.


📦 Requirements

To use the Xsens MTi IMU with ROS 2 Humble, ensure you have the following:

  • ROS 2 Humble installed on your system (Ubuntu 22.04 recommended).
  • A Colcon workspace (e.g., ~/botdev).
  • An Xsens MTi sensor (e.g., MTi-1, MTi-3, MTi-7, or MTi-600 series).
  • A USB cable or USB-to-Serial adapter (e.g., PL2303, FTDI) for connecting the sensor.
  • External power supply for UART-only sensors (if applicable).
  • Basic dependencies: ros-humble-ros-base, python3-colcon-common-extensions.

🚀 Installation

Follow these steps to set up the xsens_mti_ros2_driver package in your ROS 2 workspace:

  1. Navigate to your Colcon workspace:

    cd ~/ros2_ws/src
  2. Clone the Xsens MTi ROS 2 driver repository:

    git clone https://github.com/fs-feup/xsens-imu.git
  3. Install dependencies: Ensure all required ROS 2 dependencies are installed:

    sudo apt update
    sudo apt install ros-humble-ros-base python3-colcon-common-extensions
  4. Build the workspace:

    cd ~/ros2_ws
    colcon build --symlink-install
  5. Source the workspace:

    source ~/ros2_ws/install/setup.bash

⚙️ Configuration

  1. Connect the Xsens MTi sensor:

    • Plug the sensor into your computer via USB or a USB-to-Serial adapter.
    • For UART-only sensors, ensure an external power supply is connected.
  2. Verify device detection: Check if the sensor is detected (e.g., as /dev/ttyUSB0):

    ls /dev/tty*
  3. Set permissions (if needed): Grant access to the serial port:

    sudo chmod 666 /dev/ttyUSB0
  4. Configure the sensor (optional):

    • Use the Xsens MT Manager software to set baud rates, output formats, or other sensor settings if required.
    • Ensure the sensor’s baud rate matches the driver’s configuration (default: 115200).
  5. Update ROS parameters: Edit the driver’s configuration file (e.g., xsens_mti_ros2_driver/config/xsens_mti_node.yaml) to match your sensor’s port and settings:

    xsens_mti_node:
      ros__parameters:
        port: "/dev/ttyUSB0"
        baudrate: 115200
        frame_id: "imu_link"

🏃 Running the Driver

  1. Source the workspace (if not already done):

    source ~/ros2_ws/install/setup.bash
  2. Launch the driver: Start the ROS 2 node for the Xsens MTi sensor:

    ros2 launch xsens_mti_ros2_driver xsens_mti_node.launch.py
  3. Verify output: Check published topics (e.g., /imu/data, /imu/mag):

    ros2 topic list
    ros2 topic echo /imu/data

🛠️ Troubleshooting

  • No data on topics:

    • Verify the sensor is connected and powered.
    • Check the serial port and baud rate in the configuration file.
    • Ensure the correct permissions are set for the serial port.
  • Serial port errors:

    • Run dmesg | grep tty to debug USB-to-Serial adapter issues.
    • Try a different USB port or adapter (e.g., FTDI instead of PL2303).
    • Edit the config file, set auto_detect to false and add your port ID through ls -l /dev/ttyUSB* and the baud rate
  • Driver not building:

    • Ensure all dependencies are installed (rosdep install --from-paths src --ignore-src -r -y).
  • Incorrect IMU data:

    • Calibrate the sensor using Xsens MT Manager.
    • Verify the frame_id and coordinate system in the configuration file.

For additional support, check the Xsens Support Portal or the driver’s GitHub Issues.

2. Sick TIM5xx LiDAR (sick_scan_xd)

Install and Build the Driver (ROS2 Humble and higher)

sudo apt update
sudo apt-get install ros-humble-sick-scan-xd
colcon build

Connect the LiDAR

  • Connect your PC to the LiDAR via Ethernet.
  • Set a static IP on your PC in the same subnet as the LiDAR.

Example:

sudo ip addr add 192.168.0.10/24 dev eth0

Launch the Driver

ros2 launch sick_scan_xd sick_tim_5xx.launch.py

Known Issues & Solutions

Issue: No data on /scan topic

Cause: Protocol mismatch (Binary vs ASCII)

Default Configuration: The driver expects binary protocol.

Fix Options:

Option 1: Set Scanner to Binary Mode

Use telnet:

telnet 192.168.0.1 2111

Option 2: Run Driver in ASCII Mode

If you prefer not to change the scanner:

ros2 launch sick_scan_xd sick_tim_5xx.launch.py use_binary_protocol:=false
Notes
  • Ensure IP settings are correctly configured.
  • Temporarily disable firewall for initial setup if needed.
  • SOPAS Engineering Tool (Windows only) can help verify configuration.

About

For Teaching and Learning ROS2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors