Skip to content

The robione_ros2_driver is a ROS2 driver designed for seamless integration with Robione development robots. This driver provides a comprehensive interface for controlling and communicating with Robione robots, enabling you to unlock the full potential of your robotic platform in ROS2-based applications.

License

Notifications You must be signed in to change notification settings

Robeff-Technology/robione_ros2_driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

robione_ros2_driver

Table of Contents

  1. Description
  2. Key Features
  3. Installation
  4. Launching the Driver
  5. Configuration Parameters
  6. Subscribed Messages
  7. Published Messages
  8. Services
  9. Using rqt Plugin with Robione ROS 2 Services
  10. Managing ROBIONE USB Devices with udev Rules
  11. Using Remote Controller with Radiolink T8FB Controller

Description

The robione_ros2_driver is a powerful and flexible ROS2 driver designed for seamless integration with Robione mobile robots. This driver provides a comprehensive interface for controlling and communicating with Robione robots, enabling you to unlock the full potential of your robotic platform in ROS2-based applications.

Maintainer : Robeff Technology

Key Features

  • Plug-and-Play Compatibility: Easily connect your Robione mobile robot to ROS2 using this driver. It supports usb communication, making it a versatile solution for different robot models.

  • Real-time Feedback: Receive real-time feedback from the robot's sensors and actuators, enabling you to monitor and control the robot's state, including position, velocity, and sensor data.

  • ROS2 Ecosystem Integration: Seamlessly integrate the driver into the ROS2 ecosystem, allowing you to leverage existing ROS2 packages, tools, and libraries for developing your robot applications.

  • Customization: Tailor the driver to your specific robot configuration and requirements. Customize control interfaces, sensor configurations, and behavior parameters to suit your application needs.

  • Robione API Support: Interact with the Robione robot using the provided ROS2 API, allowing you to send commands, receive status updates, and access robot-specific functionality.

  • Open Source: This driver is open-source, encouraging collaboration and community contributions to improve its functionality and compatibility with various Robione robot models.

Whether you're developing autonomous navigation algorithms, building robotic applications for research, or simply exploring the capabilities of your Robione mobile robot, the robione_ros2_driver is your gateway to a seamless and efficient ROS2 integration experience.

Installation

This guide will walk you through the installation process for the robione_ros2_driver. Before you begin, ensure you have ROS2 Humble installed and the sensor_msgs package available. Additionally, make sure you have the necessary permissions to install packages and access the required dependencies.

Prerequisites

  • ROS2 Humble: Make sure you have a working ROS2 Humble installation. If you don't have ROS2 Humble installed, you can follow the official installation instructions: ROS2 Installation Guide.

  • sensor_msgs package installed. You can install it using the following command:

    sudo apt install ros-<ros2-distro>-sensor-msgs

Installation Steps

  1. Clone the robione_ros2_driver repository to your ROS2 workspace:

    cd /path/to/your/ros2/workspace/src
    git clone https://github.com/Robeff-Technology/robione_ros2_driver.git
  2. Build the robione_ros2_driver package:

    cd /path/to/your/ros2/workspace
    colcon build
  3. Source your ROS2 workspace to make the robione_ros2_driver package available:

    source /path/to/your/ros2/workspace/install/setup.bash

Configuration

The robione_ros2_driver package may require configuration to match your specific robot setup. You can modify the configuration parameters by editing the provided configuration file.

  1. Locate the configuration file. It is typically located at:

    /path/to/your/ros2/workspace/src/robione_ros2_driver/config/robione_ros2_driver.param.yaml
    
  2. Edit the configuration file according to your robot's specifications and requirements.

Launching the Driver

You can launch the robione_ros2_driver using the ros2 launch command. The driver launch file is provided with the package:

ros2 launch robione_ros2_driver robione_ros2_driver.launch.py

Configuration Parameters

This document provides an explanation of the configuration parameters used in the robione_ros2_driver for controlling a Robione mobile robot. You can customize these parameters in the YAML configuration file to tailor the driver's behavior to your specific requirements.

topic_config

  • control_cmd_topic: This parameter specifies the ROS topic where control commands are received. By default, it is set to /robione/control_cmd. You can modify this topic to match your desired control command input.

serial_config

  • port: The port parameter determines the serial port used for communication with the Robione robot. The default value is /dev/ttyUSB0. Ensure that it matches the correct serial port for your hardware.

  • baudrate: This parameter sets the baud rate for the serial communication. The default value is 115200. Make sure it matches the baud rate used by your robot's hardware interface.

timeout_config

  • control_cmd_timeout: This parameter sets the timeout duration for waiting for control command messages. The default value is 0.5 seconds. Adjust this timeout to match your desired control responsiveness.

Feel free to adjust these parameters in your configuration file to match the specifics of your Robione mobile robot and your control preferences.

Subscribed Messages

ControlCmd

Field Type Description Range/Constants
set_velocity float32 Velocity command Maximum and minimum velocity limits are set by the user.
steer_angle float32 Steer angle command -1.0 (full right) to 1.0 (full left)
steer_vel float32 Steering velocity command 43 to 545 degree/s
handbrake uint8 Handbrake state HANDBRAKE_ON or HANDBRAKE_OFF
emergency uint8 Emergency state EMERGENCY_OFF or EMERGENCY_ON
indicators uint8 Blinker state NO_COMMAND, HAZARD_LIGHT, LEFT_TURN_SIGNAL or RIGHT_TURN_SIGNAL
head_light uint8 Headlight state HEAD_LIGHT_OFF,LOW_HEAD_LIGHT_ON or HIGH_HEAD_LIGHT_ON

⚠️WARNING: If the user enters 'set_velocity' value greater than 0, the robot moves in the FORWARD direction, otherwise, if the user enters less than 0, the robot moves in the REVERSE direction.

💥ERROR: If values outside of this range cause emergency to robione except head_light.

Published Messages

BatteryInfo

The SystemStatus message provides information about the robot's battery and battery management system(BMS).

Field Type Description Bit Definitions
header Header header N/A
min_cell_voltage uint16 minimum cell voltage of the battery (mA) N/A
battery_temp1 uint8 [0-9]cells temperature (celcius) N/A
battery_temp2 uint8 [10-18] cells temp (celcius) N/A
battery_voltage float32 battery voltage N/A
accumulator_voltage float32 accumulator voltage N/A
battery_current float32 battery's actual current N/A
soc uint8 SoC of the battery N/A
battery_warning_messages uint16 Battery warning messages sending from BMS See bit definitions below
battery_status_info uint8 Battery status sending from BMS See bit definitions below
charge_status uint8 Robot's actual charge status. When robot starts to charge, this status will change 0-> no charging, 1->charging
system_working_time uint32 Time since the first opening of the BMS(minute) N/A

Bit Definitions

  • battery_warning_messages: Battery warning messages, where individual bits have specific meanings:

    • Bit 0: Low capacity
    • Bit 1: Power tube over capacity
    • Bit 2: Charging overvoltage
    • Bit 3: Discharging undervoltage
    • Bit 4: Battery over temperature
    • Bit 5: Charging overcurrent
    • Bit 6: Discharging overcurrent
    • Bit 7: Cell Pressure difference
    • Bit 8: Over Temperature Alarm Battery Box
    • Bit 9: Battery Low Temperature
    • Bit 10: Cell Overvoltage
    • Bit 11: Cell Undervoltage
    • Bit 12: A Protection
    • Bit 13: B Protection
  • battery_status_info: Battery status information, where individual bits have specific meanings:

    • Bit 0: Charging enabled
    • Bit 1: Discharging enabled
    • Bit 2: Balancer enabled
    • Bit 3: Battery dropped

VehicleInfo

The VehicleInfo message provides information about the vehicle.

Field Type Description
header Header header
vehicle_working_time uint32 The amount of time that has elapsed since the robot was opened.(ms)
gear uint8 Actual gear status. 0->FORWARD , 1->REVERSE
mode uint8 Actual mode. 0->CONTROLLER_NONE, 1->CONTROLLER_ROS2 2->CONTROLLER_REMOTE
handbrake uint8 Handbrake status. 0->HANDBRAKE_ON, 1->HANDBRAKE_OFF
head_light uint8 Headlights status. You can find the constants in ControlCmd section.
indicators uint8 Indicators status. You can find the constants in ControlCmd section.
intervention uint8 Intervention status. If the user takes control, the intervention value is 1.
ready uint8 When the robot becomes available for driving, ready set to 1.
emergency uint16 Emergency status of the robot. If the value is not equal to zero, the robot is in an emergency event. See bit definitions below

Bit Definitions

  • emergency: emergency sources, where individual bits have specific meanings:
    • Bit 0: EEPROM
    • Bit 1: NONE CONTROL
    • Bit 2: BATTERY VOLTAGE ERROR
    • Bit 3: ACCUMULATOR VOLTAGE ERROR
    • Bit 4: CONTROLLER EMERGENCY
    • Bit 5: REMOTE CONTROL EMERGENCY BUTTON
    • Bit 6: PRECHARGE EMERGENCY
    • Bit 7: BBW ERROR
    • Bit 8: BBW COMM ERROR
    • Bit 9: SBW COMM ERROR
    • Bit 10: PRECHARGE COMM ERROR
    • Bit 11: SBW ERROR

BBWInfo

Field Type Description Range/Constants
Header header header N/A
supply_voltage float32 Supply voltage of BBW N/A
set_angle uint16 Set angle of the BBW 0 to 360
actual_angle uint16 Actual angle of the BBW N/A
left_brake_current int16 Current of the left brake(A) N/A
right_brake_current int16 Current of the right brake(A) N/A
left_brake_status uint8 Left brake's actual status See definitions below
right_brake_status uint8 Right brake's actual status See definitions below
left_brake_calibration_status uint8 Left brake's calibration status See definitions below
right_brake_calibration_status uint8 Right brake's calibration status See definitions below
left_brake_encoder_status uint8 Left brake's encoder status See definitions below
right_brake_encoder_status uint8 Right brake's encoder status See definitions below
brake_errors uint16 BBW system errors See definitions below
emergency_source uint8 The source of the emergency See definitions below
mode uint8 BBW mode See definitions below

Definitions

  • BrakeStatus:

    • BRAKE_STATUS_RELEASED = 0,
    • BRAKE_STATUS_PRESSED = 1,
    • BRAKE_STATUS_CALIB_PRESS = 2,
    • BRAKE_STATUS_CALIB_RELEASE = 3,
    • BRAKE_STATUS_PRESSING = 4,
    • BRAKE_STATUS_RELEASING = 5,
  • CalibrationStatus:

    • CALIB_STAT_WAITING_HANDLE = 0,
    • CALIB_STAT_WAITING_RELEASE = 1,
    • CALIB_STAT_OK = 2,
    • CALIB_STAT_ERROR = 3,
  • EncoderStatus:

    • ENCODER_STATUS_OK = 0,
    • ENCODER_STATUS_LOST = 1,
    • ENCODER_STATUS_WRONG_DETECT = 2,
    • ENCODER_STATUS_REVERSE_CONNECTION = 3,
  • EmergencySource:

    • EMERGENCY_SRC_NONE = 0,
    • EMERGENCY_SRC_INTERNAL = 1,
    • EMERGENCY_SRC_VCU = 2,
    • EMERGENCY_SRC_PRECHARGE = 3,
  • BrakeModes:

    • BRAKE_HANDLE = 0,
    • BRAKE_RELEASE = 1,
    • BRAKE_CONTROL = 2,
    • BRAKE_EMERGENCY = 3,
  • BrakeErrors:

    • Bit 0: LEFT BRAKE ZPC ERROR
    • Bit 1: LEFT BRAKE MOTOR CONNECTION ERROR
    • Bit 2: LEFT BRAKE NO LOAD ERROR
    • Bit 3: LEFT BRAKE OVER CURRENT ERROR
    • Bit 4: RIGHT BRAKE ZPC ERROR
    • Bit 5: RIGHT BRAKE MOTOR CONNECTION ERROR
    • Bit 6: RIGHT BRAKE NO LOAD ERROR
    • Bit 7: RIGHT BRAKE OVER CURRENT ERROR
    • Bit 8: BRAKE CAN ERROR
    • Bit 9: UNDERVOLTAGE ERROR

SBWInfo

The SBWInfo message provides information about the steer-by-wire system.

Field Type Description
header Header header
mode uint8 Current mode of SBW
wheel_torque uint8 Raw torque val. 128-> equals 0 torque.
fault_code1 uint8 Fault code
status uint8 status of SBW
fault_code2 uint8 See definitions below

Definitions

  • FaultCode2:
  • NoExternalCrystalOscillator = 0x10U
  • EEPROMReadAndWriteFailure = 0X14U
  • TheMainTorqueSensorIsDisconnected = 0X21U
  • TheSteeringWheelAngleMidpointIsNotWritten = 0X12U
  • TheOutputOfTheMainTorqueSensorIsAbnormal = 0X22U
  • AuxiliaryTorqueSensorDisconnected = 0X23U
  • SecondaryTorqueSensorOutputIsAbnormal = 0X24U
  • PowerModuleFailure = 0X34U
  • TheMainAndAuxiliaryTorqueDifferenceIsTooLarge = 0X25U
  • TheBusCurrentIsAbnormal = 0X37U
  • TheDifferenceTorqueTooLarge = 0X26U
  • TheMotorCurrentIsAbnormal = 0X35U
  • MotorWithoutPowerAssist = 0X32U
  • PowerAssistFunctionDisorder = 0X36U
  • Overcurrent = 0X33U
  • PowerSupplyUndervoltage = 0X41U
  • ThermalProtection = 0X46U
  • PowerSupplyOvervoltage = 0X42U
  • PinionAngleSensorIsDisconnected = 0X61U
  • MotorTerminalVoltageIsAbnormal = 0x43U
  • MiddleGearAngleSensorDisconnected = 0X62U

CommPeriodInfo

The CommPeriodInfo message provides information about the all system's communication periods.

Field Type Description
header Header header
ros_msg_period float32 Communication period of ros2_driver and the robot. This period must be 20 ms(ms)
brake_status_period float32 BBW brake status message period.(ms)
brake_encoder_period float32 BBW encoder status message period.(ms)
remote_control_period float32 Remote control and VCU communication period.(ms)
sbw_period float32 SBW and VCU communication period.(ms)
bms_period float32 BMS and precharge communication period.(ms)
precharge_period float32 Precharge and VCU communication period.(ms)

ControlInfo

The ControlInfo message provides information about the control.

Field Type Description
header Header header
velocity float32 The actual velocity of the robot is calculated based on the direction of movement. If the direction is forward, the velocity is positive. Conversely, if the direction is reverse, the velocity is negative.(m/s)
acceleration float32 Actual acceleration of the robot. (m/s2)
steering_angle int16 Actual steering angle of the robot.(degree) [-300, 300]
steering_angle_velocity float32 Actual steering angle velocity of the robot
throttle uint16 Current throttle value of the robot. O throttle isequals to 1300

Services

This ROS 2 package contains custom service messages used by the Robione ROS 2 driver for communication with the Robione robot. This services allows users to modify all speed and brake configurations, It also enables users to check current parameters and save the robot's EEPROM.

Service Messages

CheckParams

This service message is used to check parameters related to speed and brake configurations.

Request:

Field Type Description
param_type uint8 which parameters you would like to be checked. 0->SPEED_PARAMS 1-> BRAKE_PARAMS

Response:

Field Type Description
success bool Indicates whether the parameter check was successful.
info std_msgs/String Additional information message.

ConfigParams

This service message is used to configure PID controller parameters (kp, ki, kd) and a maximum limit value.

Request:

Field Type Description
kp float32 Proportional gain.
ki float32 Integral gain.
kd float32 Derivative gain.
max_limit float32 Maximum limit value.

Response:

Field Type Description
success bool Indicates whether the parameter configuration was successful.
info string Additional information message.
kp float32 Configured proportional gain.
ki float32 Configured integral gain.
kd float32 Configured derivative gain.
max_limit float32 Configured maximum limit value.

EepromSave

This service message is used to save data to EEPROM.

Request:

  • No request data.

Response:

Field Type Description
success bool Indicates whether the data saving operation was successful.
info string Additional information message.

Using rqt Plugin with Robione ROS 2 Services

This guide explains how to use the rqt plugin to interact with the ROS 2 services provided by the Robione ROS 2 driver package. The rqt plugin allows you to configure PID controller parameters and check parameters related to speed and brake configurations using a graphical user interface.

Launching robione_ros2_driver and Using rqt

The robione_ros2_driver must be run before opening the rqt.

  1. Navigate to the ros2_workspace directory:

    cd <path_to_your_ros2_ws>
  2. Source the ROS 2 setup file to add the package to your ROS 2 environment:

    source install/setup.bash
  3. Launch the robione_ros2_driver package to start the ROS 2 nodes:

    ros2 launch robione_ros2_driver robione_ros2_driver.launch.py
  4. Launch the rqt plugin:

    rqt
  5. In the rqt GUI, navigate to the "Plugins -> Services" section to interact with ROS 2 services. Here, you will find a list of available services provided by your robione_ros2_driver package. Select the desired service to open a dialog for calling the service with appropriate parameters.

Checking Parameters with CheckParams Service

The CheckParams service provided by the Robione ROS 2 driver package allows you to check parameters related to speed and brake configurations. Follow these steps to use the service with the rqt plugin:

  1. Navigate to Services Plugin: In the rqt GUI, navigate to the "Plugins -> Services" section. This section lists all available ROS 2 services.

  2. Find CheckParams Service: In the Services section, locate the CheckParams service provided by the robione_ros2_driver package. It should be listed along with other available services.

  3. Select CheckParams Service: Click on the CheckParams service to open a dialog for calling the service.

  4. Select Which Parameter Check: The param_type can be seen in the request section of CheckParams. To check SPEED_PARAMS, please enter the value as 0. Conversely, to check BRAKE_PARAMS, please enter 1. If you enter a value other than the specified values, you will receive an error response.

  5. Call the Service: Once the dialog for the CheckParams service is open, you can simply click the "Call Service" button to trigger the service call.

  6. Check Response: After calling the service, wait for the response. If the parameter check is successful, you will receive a response indicating success along with any additional information. If there are any errors or issues with the parameters, you will receive an error message in the response.

  7. Review Response: Review the response message to determine the status of the parameter check and any relevant information provided.

  8. Close Dialog: Once you have reviewed the response, you can close the dialog for the CheckParams service.

Configuring Parameters with ConfigParams Service

The ConfigParams service provided by the Robione ROS 2 driver package allows you to configure PID controller parameters (kp, ki, kd) and a maximum limit value. Follow these steps to use the service with the rqt plugin:

  1. Launch the rqt Plugin: First, launch the rqt GUI using the rqt command in your terminal.

  2. Navigate to Services Plugin: In the rqt GUI, navigate to the "Plugins -> Services" section. This section lists all available ROS 2 services.

  3. Find ConfigParams Service: In the Services section, locate the ConfigParams service provided by the robione_ros2_driver package. It should be listed along with other available services.

  4. Select ConfigParams Service: Click on the ConfigParams service to open a dialog for calling the service.

  5. Input Parameters: In the dialog for the ConfigParams service, you will see input fields for the PID controller parameters (kp, ki, kd) and the maximum limit value. Enter the desired values for these parameters.

  6. Call the Service: Once you have entered the desired parameter values, click the "Call Service" button to trigger the service call.

  7. Check Response: After calling the service, wait for the response. If the parameter configuration is successful, you will receive a response indicating success along with any additional information. If there are any errors or issues with the parameters, you will receive an error message in the response.

  8. Review Response: Review the response message to determine the status of the parameter configuration and any relevant information provided.

  9. Close Dialog: Once you have reviewed the response, you can close the dialog for the ConfigParams service.

By following these steps, you can easily configure PID controller parameters and maximum limit value using the ConfigParams service with the rqt plugin.

Saving Data to EEPROM with EepromSave Service

The EepromSave service provided by the Robione ROS 2 driver package allows you to save data to EEPROM. Follow these steps to use the service with the rqt plugin:

  1. Launch the rqt Plugin: First, launch the rqt GUI using the rqt command in your terminal.

  2. Navigate to Services Plugin: In the rqt GUI, navigate to the "Plugins -> Services" section. This section lists all available ROS 2 services.

  3. Find EepromSave Service: In the Services section, locate the EepromSave service provided by the robione_ros2_driver package. It should be listed along with other available services.

  4. Select EepromSave Service: Click on the EepromSave service to open a dialog for calling the service.

  5. Click the "Call Service" button to trigger the service call.

  6. Check Response: After calling the service, wait for the response. If the data saving operation is successful, you will receive a response indicating success along with any additional information. If there are any errors or issues with the data saving operation, you will receive an error message in the response.

  7. Review Response: Review the response message to determine the status of the data saving operation and any relevant information provided.

  8. Close Dialog: Once you have reviewed the response, you can close the dialog for the EepromSave service.

By following these steps, you can easily save data to EEPROM using the EepromSave service with the rqt plugin.

Managing ROBIONE USB Devices with udev Rules

Introduction

udev is a device manager for the Linux kernel. It manages device nodes in /dev/, and handles all user space events raised while hardware devices are added into or removed from the system.

  1. Identify the USB Device

    • Plug in your USB device.
    • Open a terminal.
    • Use the lsusb command to list all connected USB devices:
      lsusb
    • Note down the idVendor and idProduct of your USB device.
  2. Create a udev Rule

    • Open a terminal.
    • Navigate to the /etc/udev/rules.d/ directory:
      cd /etc/udev/rules.d/
    • Create a new rule file. For example:
      sudo nano 99-usb-serial.rules
    • Add a rule in the following format, replacing XXXX and YYYY with your idVendor and idProduct:
      CTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", MODE="0666", SYMLINK+="ttyROBIONE"
    • Save the file and exit the text editor.
  3. Reload udev Rules

    • After creating or modifying the rule file, reload the udev rules for the changes to take effect:
      sudo udevadm control --reload-rules
  4. Restart udev Service

    • Sometimes it's necessary to restart the udev service for the changes to take effect:
      sudo systemctl restart udev
  5. Verify

    • Plug in your USB device again.
    • Use ls -l to check if the symlink is created and permissions are set correctly:
      ls -l /dev/tty*

Conclusion

You have now successfully created a udev rule to manage your USB device. This rule ensures that specific actions are taken automatically when the USB device is plugged into your system.

Using Remote Controller with Radiolink T8FB Controller

T8FB Features

-One two-way switch, one three-way switch, two VR switches, four trimmers, two sticks.

-Universal JST battery connector supports multiple batteries, include 4pcs AA batteries or 2S to 4S LiPo battery.

-Default low voltage alarm to 5.0V automatically after detection.

Buttons Functions

SwA

It is used for emergencies. Emergency is activated when the button is in the forward direction and when it is in reverse, it is in drive mode. When the emergency is activated, the vehicle brakes.

SwB

It is used to determine the direction of the vehicle and to apply the handbrake. In the up position, the vehicle direction is forward, in the middle position, the vehicle is in reverse mode. At the bottom, the handbrake of the vehicle is applied.

VrB

It is used to change the controller. When pushed forward, the vehicle goes into autonomous mode and when pulled back, the control passes to the remote.

Rudder(Left Stick)

It is used to adjust the steering angle.

Aileron(Right Stick)

It is used to drive the vehicle and to brake gradually. When pushed forward, the vehicle accelerates. When retracted, the brake is applied gradually.

image

Modes

Autonomous Mode

When the vehicle is put into this mode, the vehicle is driven autonomously with the commands coming from the computer.

Remote Mode

When this mode is switched on, the computer is disabled and control passes to the remote control, and the vehicle is controlled manually.

Warnings

⚠️ If the battery of the remote control runs out, the remote makes a beep sound. In this case, the remote control battery needs to be replaced or charged for 10 minutes.

⚠️ It is not recommended to use the remote control at a distance of more than 15 meters.

About

The robione_ros2_driver is a ROS2 driver designed for seamless integration with Robione development robots. This driver provides a comprehensive interface for controlling and communicating with Robione robots, enabling you to unlock the full potential of your robotic platform in ROS2-based applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published