Skip to content

ROS support for the MiR100 Robot. This is a community project to use the MiR Robots with ROS. It is not affiliated with Mobile Industrial Robots.

License

Notifications You must be signed in to change notification settings

jr-robotics/mir_robot

 
 

Repository files navigation

mir_driver

This repo contains a ROS driver and ROS configuration files (URDF description, Gazebo launch files, move_base config, bringup launch files, message and action descriptions) for the MiR 100 robot. This is a community project created by us (DFKI, the German Research Center for Artificial Intelligence) to use the MiR Robots with ROS. We are not affiliated with Mobile Industrial Robots. If you find a bug or missing feature in this software, please report it on the issue tracker.

Package overview

  • mir_actions: Action definitions for the MiR robot
  • mir_description: URDF description of the MiR robot
  • mir_dwb_critics: Plugins for the dwb_local_planner used in Gazebo
  • mir_driver: A reverse ROS bridge for the MiR robot
  • mir_gazebo: Simulation specific launch and configuration files for the MiR robot
  • mir_msgs: Message definitions for the MiR robot
  • mir_navigation: move_base launch and configuration files

Installation

You can chose between binary and source install below. If you don't want to modify the source, the binary install is preferred (if mir_robot binary packages are available for your ROS distro). The instructions below use the ROS distro kinetic as an example; if you use a different distro (e.g. indigo), replace all occurrences of the string kinetic by your distro name in the instructions.

Preliminaries

If you haven't already installed ROS on your PC, you need to add the ROS apt repository. This step is necessary for either binary or source install.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update -qq

Binary install

For a binary install, it suffices to run this command:

sudo apt install ros-kinetic-mir-robot

See the tables at the end of this README for a list of ROS distros for which binary packages are available.

Source install

For a source install, run the commands below instead of the command from the "binary install" section.

# create a catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/

# clone mir_robot into the catkin workspace
git clone -b kinetic https://github.com/dfki-ric/mir_robot.git

# use rosdep to install all dependencies (including ROS itself)
sudo apt-get update -qq
sudo apt-get install -qq -y python-rosdep
sudo rosdep init
rosdep update
rosdep install --from-paths ./ -i -y --rosdistro kinetic

# build all packages in the catkin workspace
source /opt/ros/kinetic/setup.bash
catkin_init_workspace
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=RelWithDebugInfo

In case you encounter problems, please compare the commands above to the build step in .travis.yml; that should always have the most recent list of commands.

You should add the following line to the end of your ~/.bashrc, and then close and reopen all terminals:

source ~/catkin_ws/devel/setup.bash

Gazebo demo (existing map)

### gazebo:
roslaunch mir_gazebo mir_maze_world.launch
rosservice call /gazebo/unpause_physics   # or click the "start" button in the Gazebo GUI

### localization:
roslaunch mir_navigation amcl.launch initial_pose_x:=10.0 initial_pose_y:=10.0
# or alternatively: roslaunch mir_gazebo fake_localization.launch delta_x:=-10.0 delta_y:=-10.0

# navigation:
roslaunch mir_navigation start_planner.launch \
    map_file:=$(rospack find mir_gazebo)/maps/maze.yaml \
    virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/maze_virtual_walls.yaml
rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz

Now, you can use the "2D Nav Goal" tool in RViz to set a navigation goal for move_base.

MiR100 robot: navigation in Gazebo (4x)

(Click image to see video)

Gazebo demo (mapping)

### gazebo:
roslaunch mir_gazebo mir_maze_world.launch
rosservice call /gazebo/unpause_physics   # or click the "start" button in the Gazebo GUI

### mapping:
roslaunch mir_navigation hector_mapping.launch.xml

# navigation:
roslaunch mir_navigation move_base.xml with_virtual_walls:=false
rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz

Running the driver on the real robot

Start up the robot

  • switch on MiR base

Connect to the MiR web interface

  • connect to MiR_R??? wifi (password "mirex4you"), for example from your Android phone/tablet
  • disable other network connections (mobile data / LAN / etc.)
  • open mir.com (192.168.12.20) in Chrome (!)
  • log in (admin/mir4you)

Synchronize system time

The internal robot PC's is not synchronized (for example via NTP), so it tends to get out of sync quickly (about 1 second per day!). This causes TF transforms timing out etc. and can be seen using tf_monitor (the "Max Delay" is about 3.3 seconds, but should be less than 0.1 seconds):

$ rosrun tf tf_monitor
Frames:
Frame: /back_laser_link published by unknown_publisher Average Delay: 3.22686 Max Delay: 3.34766
Frame: /base_footprint published by unknown_publisher Average Delay: 3.34273 Max Delay: 3.38062
Frame: /base_link published by unknown_publisher Average Delay: 3.22751 Max Delay: 3.34844
Frame: /front_laser_link published by unknown_publisher Average Delay: 3.22661 Max Delay: 3.34159
Frame: /imu_link published by unknown_publisher Average Delay: 3.22739 Max Delay: 3.34738
Frame: /odom_comb published by unknown_publisher Average Delay: 3.16493 Max Delay: 3.28667
[...]

All Broadcasters:
Node: unknown_publisher 418.344 Hz, Average Delay: 0.827575 Max Delay: 3.35237
Node: unknown_publisher(static) 465.362 Hz, Average Delay: 0 Max Delay: 0

To fix this:

  • go to "Service" -> "Configuration" -> "System settings" -> "Time settings" -> "Set device time on robot"

Afterwards, the ROS software on the robot will restart, so you'll have to start move_base again (see below).

Start move_base on the robot

  • go to "Service" -> "Configuration" -> "Launch menu", start "Planner"; this starts move_base and amcl on the robot

Teleoperate the robot (optional)

  • go to "Manual", press yellow button (LEDs change from yellow to blue); now the robot can be teleoperated

Relocalize robot (optional)

If the robot's localization is lost:

  • go to "Service" -> "Command view" -> "Set start position" and click + drag to current position of robot in the map
  • click "Adjust"

Start the ROS driver

roslaunch mir_driver mir.launch

Troubleshooting

Q: I can't get the Gazebo demos running. The robot can be teleoperated, but mapping / localization / obstacle avoidance is not working.

A: Check that the laser scans are properly simulated. If not, your graphics card is probably not compatible with Gazebo - please try running it on a computer with a NVidia graphics card. See: #1, #32

Travis - Continuous Integration

Kinetic Melodic
Build Status Build Status

ROS Buildfarm

Kinetic source deb Kinetic binary deb Melodic source deb Melodic binary deb
mir_actions Build Status Build Status Build Status Build Status
mir_description Build Status Build Status Build Status Build Status
mir_driver Build Status Build Status Build Status Build Status
mir_gazebo Build Status Build Status Build Status Build Status
mir_msgs Build Status Build Status Build Status Build Status
mir_navigation Build Status Build Status Build Status Build Status
mir_robot Build Status Build Status Build Status Build Status
Kinetic devel Kinetic doc Melodic devel Melodic doc
mir_robot Build Status Build Status Build Status Build Status

About

ROS support for the MiR100 Robot. This is a community project to use the MiR Robots with ROS. It is not affiliated with Mobile Industrial Robots.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 53.2%
  • C++ 25.9%
  • MATLAB 12.6%
  • CMake 8.3%