Skip to content
Snippets Groups Projects

Description

This node provides a system to detect and manage collisions using a bno055 IMU connected with an USB to TTL serial cable.

This node also provides the following configuration files located in config directory:

  • params.yaml: Node default configuration file.
  • bno055.yaml: IMU default configuration file

It also provides a default bno055 calibration file.

ROS Interface

Topic subscribers

  • ~rear_laser_scan (sensor_msgs/LaserScan.msg): Rear laser scan input data.
  • ~front_laser_scan (sensor_msgs/LaserScan.msg): Front laser scan input data.
  • /tf (tf/tfMessage): Robot tf.
  • ~imu (sensor_msgs/Imu.msg): Imu input data.

Service clients

  • ~icp (iri_laser_scan_icp/icp.srv): ICP server.

Parameters

  • ~rate (Double; default: 10.0; min: 0.1; max: 1000): The main node thread loop rate in Hz.
  • ~fixed_frame (String; default: base_link): Fixed frame id.
  • ~tf_timeout (Double; default: 0.2; min: 0.1; max: 2.0): Timeout to find a transform.
  • ~err_msg_rate (Double; default: 0.5; min: 0.1; max: 1.0): Rate to publish error messages.
  • ~collision_transition_counter_en (Boolean; default: False): Enable the collision counter.
  • ~collision_timeout (Double; default: 4.0; min: 1.0; max: 10.0): Timeout to detect an end of collision.
  • ~collision_acc_th (Double; default: 9.8; min: 0.1; max: 160.0): Threshold to detect a collision.
  • ~collision_counter_limit (Integer; default: 6; min: 1; max: 30): Number of low acc imu meassures to detect an end of collision.
  • ~front_laser_en (Boolean; default: True): Enable front laser for ICP.
  • ~rear_laser_en (Boolean; default: True): Enable rear laser for ICP.
  • ~scan_buffer_size (Integer; default: 3; min: 1; max: 10): Number of laser_scan buffered for the ICP.
  • ~scan_diff_t_from_collision (Double; default: 0.0; min: 0.0; max: 0.5): Time to subtract from collision time stamp to ensure a clean scan.

Installation

External dependencies

  • bno055_imu_driver: This is the bno055 imu driver. To install it run the following commands:

    sudo apt install ca-certificates
    sudo sh -c 'echo "deb [arch=amd64] https://labrepo.iri.upc.edu/packages $(lsb_release -cs) main" > /etc/apt/sources.list.d/labrobotica_repo.list'
    wget -O - https://labrepo.iri.upc.edu/labrobotica_repo.gpg.key | sudo apt-key add -
    sudo apt update && sudo apt install iri-bno055-imu-driver-dev

    If there is any problem with the installation, you can follow the instructions on how to install it from sources:

    source installation

    roscd && cd ..
    mkdir source_code && cd source_code
    git clone https://gitlab.iri.upc.edu/labrobotica/algorithms/iriutils.git
    cd iriutils
    mkdir build && cd build
    cmake .. -DCMAKE_BUILD_TYPE=RELEASE
    make -j$nproc
    sudo make install
    ../scripts/add_lib_to_ld_config.sh -liriutils
    sudo ldconfig
    roscd && cd ../source_code
    git clone https://gitlab.iri.upc.edu/labrobotica/drivers/comm.git
    cd comm
    mkdir build && cd build
    cmake .. -DCMAKE_BUILD_TYPE=RELEASE
    make -j$nproc
    sudo make install
    roscd && cd ../source_code/iriutils
    ./scripts/add_lib_to_ld_config.sh -lcomm
    sudo ldconfig
    roscd && cd ../source_code
    git clone https://gitlab.iri.upc.edu/labrobotica/drivers/bno055_imu_driver.git
    cd bno055_imu_driver
    mkdir build && cd build
    cmake .. -DCMAKE_BUILD_TYPE=RELEASE
    make -j$nproc
    sudo make install
    roscd && cd ../source_code/iriutils
    ./scripts/add_lib_to_ld_config.sh -lbno055_imu_driver
    sudo ldconfig

    At this point we will have installed all the c++ libraries. /etc/ must have the following lines:

    /usr/local/lib/iri/iriutils
    /usr/local/lib/iri/comm
    /usr/local/lib/iri/bno055_imu_driver
  • iri_base_algorithm: Move to your active workspace, clone this repository and compile your workspace.

  • iri_base_driver: Move to your active workspace, clone this repository and compile your workspace.

  • iri_bno055_imu_driver: Move to your active workspace, clone this repository and compile your workspace.

  • iri_bno055_imu_bringup: Move to your active workspace, clone this repository and compile your workspace.

Other dependencies

Move to the active workspace:

roscd && cd ../src

Clone the repository:

git clone <url>

Install ROS dependencies:

roscd
cd ..
rosdep install -i -r --from-paths src

Compile the workspace:

catkin_make

How to use it

This node provides the following launch files:

  • node.launch: Launch file intended to be included by a general launch file. It has the following arguments:

    • node_name: Node name.
    • config_file: Node configuration yaml file.
    • imu_topic: IMU input data topic name to be remaped.
    • output: Ros node launch output's parameter.
    • launch_prefix: Ros node launch launch-prefix's parameter.
  • test.launch: Launch file for development purpouses. It has the following arguments:

    • collision_config_file: Node configuration yaml file.
    • imu_topic: IMU input data topic name to be remaped.
    • output: Ros node launch output's parameter.
    • launch_prefix: Ros node launch launch-prefix's parameter.
    • dr: Boolean to launch rqt_reconfigure.
    • sim_time: Boolean to set /use_sim_time parameter.
  • imu_and_collisions.launch: General launch file with IMU driver and collision managment. It has the following arguments:

    • collision_config_file: Collision managment node configuration yaml file.
    • imu_topic: IMU input data topic name to be remaped.
    • output: Ros node launch output's parameter.
    • launch_prefix: Ros node launch launch-prefix's parameter.
    • dr: Boolean to launch rqt_reconfigure.
    • sim_time: Boolean to set /use_sim_time parameter.
    • imu_config_file: IMU driver node configuration yaml file.
    • imu_calibration_file: IMU calibration file (not used for raw data mode).
  • rosbag_and_rviz.launch: Launch file for development and debugging purpouses.

Disclaimer

Copyright (C) Institut de Robòtica i Informàtica Industrial, CSIC-UPC. Mantainer IRI labrobotics (labrobotica@iri.upc.edu)

This package is distributed in the hope that it will be useful, but without any warranty. It is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. should the program prove defective, the GMR group does not assume the cost of any necessary servicing, repair or correction.

In no event unless required by applicable law the author will be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if the author has been advised of the possibility of such damages.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/