Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MiR 100 hook and cart for ROS Noetic #120

Open
wants to merge 12 commits into
base: noetic
Choose a base branch
from
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ This repo has been tested with the following MiR software versions:
You can try if it works with other versions, but these are the ones that are
known to work.

It also supports the MiR hook with a connected cart (docking the cart is not simulated).


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_hook_description`: URDF description of the MiR hook and a cart
* `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
Expand Down Expand Up @@ -130,7 +133,8 @@ roslaunch mir_navigation amcl.launch initial_pose_x:=10.0 initial_pose_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
virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/maze_virtual_walls.yaml \
mir_hook:=False
rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz
```

Expand All @@ -153,6 +157,18 @@ roslaunch mir_navigation move_base.xml with_virtual_walls:=false
rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz
```

Gazebo demo (MiR with hook and cart)
----------------------------------------

To start the demo with a MiR robot that uses the hook and has a connected cart
just add `mir_hook:=True` (note the capitalized *T* ) to the gazebo-command:

```bash
roslaunch mir_gazebo mir_maze_world.launch mir_hook:=True
```

you can then run the other commands like you would strat the normal simulation.

Gazebo demo (MiR 250 in warehouse Gazebo world)
-----------------------------------------------

Expand Down Expand Up @@ -212,7 +228,9 @@ roslaunch mir_gazebo mir_maze_world.launch tf_prefix:=mir
roslaunch mir_navigation amcl.launch initial_pose_x:=10.0 initial_pose_y:=10.0 tf_prefix:=mir#
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 prefix:=mir/
mir_hook:=False \
virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/maze_virtual_walls.yaml \
prefix:=mir/
ROS_NAMESPACE=mir rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz

# spawn second MiR into Gazebo
Expand All @@ -222,7 +240,9 @@ roslaunch mir_gazebo mir_gazebo_common.launch robot_x:=-2 robot_y:=-2 tf_prefix:
roslaunch mir_navigation amcl.launch initial_pose_x:=8.0 initial_pose_y:=8.0 tf_prefix:=mir2
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 prefix:=mir2/
mir_hook:=False \
virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/maze_virtual_walls.yaml \
prefix:=mir2/
ROS_NAMESPACE=mir2 rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz
```

Expand Down
2 changes: 2 additions & 0 deletions mir_description/launch/mir_debug_urdf.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

<launch>
<arg name="mir_type" default="mir_100" doc="The MiR variant. Can be 'mir_100' or 'mir_250' for now." />
<arg name="mir_hook" default="False" doc="Add the MiR Hook." />
<arg name="gui" default="true" />

<!-- load MiR URDF -->
<include file="$(find mir_description)/launch/upload_mir_urdf.launch">
<arg name="mir_type" value="$(arg mir_type)" />
<arg name="mir_hook" value="$(arg mir_hook)" />
</include>

<node if="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
Expand Down
3 changes: 2 additions & 1 deletion mir_description/launch/upload_mir_urdf.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" ?>
<launch>
<arg name="mir_type" default="mir_100" doc="The MiR variant. Can be 'mir_100' or 'mir_250' for now." />
<arg name="mir_hook" default="False" doc="Add the MiR Hook." />
<arg name="tf_prefix" default="" doc="TF prefix to use for all of the MiR's TF frames"/>

<param name="robot_description" command="$(find xacro)/xacro $(find mir_description)/urdf/mir.urdf.xacro mir_type:=$(arg mir_type) tf_prefix:=$(arg tf_prefix)" />
<param name="robot_description" command="$(find xacro)/xacro $(find mir_description)/urdf/mir.urdf.xacro mir_type:=$(arg mir_type) tf_prefix:=$(arg tf_prefix) mir_hook:=$(arg mir_hook)" />
</launch>
8 changes: 8 additions & 0 deletions mir_description/urdf/mir.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
<xacro:include filename="$(find mir_description)/urdf/include/mir_v1.urdf.xacro" />
<xacro:include filename="$(find mir_description)/urdf/include/common.gazebo.xacro" />

<!-- MiR hook and cart -->
<xacro:property name="mir_hook" value="$(arg mir_hook)" />
<xacro:if value="${mir_hook == True}">
<xacro:include filename="$(find mir_hook_description)/urdf/include/mir_hook_common.urdf.xacro" />
<xacro:include filename="$(find mir_hook_description)/urdf/include/cart.urdf.xacro" />
<xacro:include filename="$(find mir_hook_description)/urdf/include/hook.urdf.xacro" />
</xacro:if>

<xacro:arg name="tf_prefix" default="" />
<xacro:property name="tf_prefix_" value="$(arg tf_prefix)" />
<xacro:if value="${tf_prefix_ == ''}">
Expand Down
17 changes: 14 additions & 3 deletions mir_gazebo/launch/mir_empty_world.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<?xml version="1.0" ?>
<launch>
<!-- show Gazebo gui, only start gazebo server if set to false. for headless mode set gui and teleop to false. -->
<arg name="gui" default="true" />
<!-- start rqt_robot_steering to control the robot manually -->
<arg name="teleop" default="true" />
<!-- run simulation paused -->
<arg name="paused" default="true" />

<arg name="world_name" default="worlds/empty.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable, but can also be an absolute path -->

<arg name="robot_x" default="0.0" />
<arg name="robot_y" default="0.0" />
<arg name="robot_yaw" default="0.0" />

<arg name="mir_type" default="mir_100" doc="The MiR variant. Can be 'mir_100' or 'mir_250' for now." />
<arg name="mir_hook" default="False" doc="Add the MiR Hook (True/False)" />

<arg name="tf_prefix" default="" doc="tf_prefix to be used by gazebo plugins and in the robot's urdf etc." />

Expand All @@ -21,18 +28,20 @@

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world_name)"/>
<arg name="paused" value="true" />
<arg name="paused" value="$(arg paused)" />
<arg name="gui" value="$(arg gui)" />
</include>
</group>

<group ns="$(arg namespace)">
<!-- spawn robot and bring up controllers etc. -->
<include file="$(find mir_gazebo)/launch/mir_gazebo_common.launch">
<arg name="teleop" value="$(arg teleop)" />
<arg name="robot_x" value="$(arg robot_x)" />
<arg name="robot_y" value="$(arg robot_y)" />
<arg name="robot_yaw" value="$(arg robot_yaw)" />
<arg name="mir_type" value="$(arg mir_type)" />
<arg name="mir_hook" value="$(arg mir_hook)" />
<arg name="tf_prefix" value="$(arg tf_prefix)" />
</include>
</group>
Expand All @@ -48,17 +57,19 @@

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world_name)"/>
<arg name="paused" value="true" />
<arg name="paused" value="$(arg paused)" />
<arg name="gui" value="$(arg gui)" />
</include>
</group>

<!-- spawn robot and bring up controllers etc. -->
<include file="$(find mir_gazebo)/launch/mir_gazebo_common.launch">
<arg name="teleop" value="$(arg teleop)" />
<arg name="robot_x" value="$(arg robot_x)" />
<arg name="robot_y" value="$(arg robot_y)" />
<arg name="robot_yaw" value="$(arg robot_yaw)" />
<arg name="mir_type" value="$(arg mir_type)" />
<arg name="mir_type" value="$(arg mir_type)" />
<arg name="mir_hook" value="$(arg mir_hook)" />
<arg name="tf_prefix" value="$(arg tf_prefix)" />
</include>
</group>
Expand Down
14 changes: 12 additions & 2 deletions mir_gazebo/launch/mir_gazebo_common.launch
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,35 @@
<arg name="robot_yaw" default="0.0" />

<arg name="mir_type" default="mir_100" doc="The MiR variant. Can be 'mir_100' or 'mir_250' for now." />
<arg name="mir_hook" default="False" doc="Add the MiR Hook" />

<arg name="tf_prefix" default="" doc="tf_prefix to be used by gazebo plugins and in the robot's urdf etc." />

<arg name="prefix" value="$(arg tf_prefix)/" if="$(eval tf_prefix != '')" /> <!-- $(arg prefix) is used in all the config files! TODO: For multiple robots, create groups when loading the parameters to overwrite the arg? -->
<arg name="prefix" value="" unless="$(eval tf_prefix != '')" />

<arg name="model_name" default="mir" doc="Name of the Gazebo robot model (needs to be different for each robot)" />
<!-- start rqt_robot_steering to control the robot manually -->
<arg name="teleop" default="true" />

<arg name="model_name" default="mir" doc="Name of the Gazebo robot model (needs to be different for each robot)" />

<!-- Load URDF -->
<include file="$(find mir_description)/launch/upload_mir_urdf.launch">
<arg name="mir_type" value="$(arg mir_type)" />
<arg name="mir_hook" value="$(arg mir_hook)" />
<arg name="tf_prefix" value="$(arg tf_prefix)" />
</include>

<!-- Spawn the robot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model $(arg model_name)
-x $(arg robot_x) -y $(arg robot_y) -Y $(arg robot_yaw) " />

<!-- control params for the hook -->
<rosparam command="load"
file="$(find mir_hook_description)/urdf/config/gazebo_ros_control_params.yaml"
if="$(eval mir_hook == True)" />


<!-- Load ros_control controller configurations -->
<rosparam file="$(find mir_description)/config/joint_state_controller.yaml" command="load" />
<rosparam file="$(find mir_description)/config/diffdrive_controller.yaml" command="load" subst_value="true" />
Expand All @@ -47,7 +57,7 @@
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen" />

<!-- Load teleop -->
<node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
<node if="$(arg teleop)" name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
<param name="default_topic" value="cmd_vel"/>
<param name="default_vx_max" value="1.0" />
<param name="default_vx_min" value="-1.0" />
Expand Down
8 changes: 7 additions & 1 deletion mir_gazebo/launch/mir_maze_world.launch
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<?xml version="1.0"?>
<launch>
<arg name="gui" default="true" />
<arg name="mir_type" default="mir_100" doc="The MiR variant. Can be 'mir_100' or 'mir_250' for now." />
<arg name="paused" default="true" />
<arg name="teleop" default="true" />
<arg name="mir_type" default="mir_100" doc="The MiR variant. Can be 'mir_100' or 'mir_100' for now." />
<arg name="mir_hook" default="False" doc="Add the MiR Hook" />
<arg name="tf_prefix" default="" doc="tf_prefix to be used by gazebo plugins and in the robot's urdf etc." />

<include file="$(find mir_gazebo)/launch/mir_empty_world.launch">
<arg name="gui" value="$(arg gui)" />
<arg name="paused" value="$(arg paused)" />
<arg name="teleop" value="$(arg teleop)" />
<arg name="mir_type" value="$(arg mir_type)" />
<arg name="mir_hook" value="$(arg mir_hook)" />
<arg name="tf_prefix" value="$(arg tf_prefix)" />
</include>

Expand Down
1 change: 1 addition & 0 deletions mir_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
<exec_depend>rostopic</exec_depend>
<exec_depend>rqt_robot_steering</exec_depend>
<exec_depend>topic_tools</exec_depend>
<exec_depend>mir_hook_description</exec_depend>
</package>
27 changes: 27 additions & 0 deletions mir_hook_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_policy(SET CMP0048 NEW)
project(mir_hook_description)

find_package(catkin REQUIRED COMPONENTS)

###################################
## catkin specific configuration ##
###################################
catkin_package()

#############
## Install ##
#############

# Mark other files for installation (e.g. launch and bag files, etc.)
install(DIRECTORY
meshes
urdf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

#############
## Testing ##
#############

# roslaunch_add_file_check(launch)
Binary file added mir_hook_description/meshes/cart/Cylinder.stl
Binary file not shown.
Binary file added mir_hook_description/meshes/cart/Cylinder_001.stl
Binary file not shown.
Binary file added mir_hook_description/meshes/cart/Cylinder_002.stl
Binary file not shown.
Binary file added mir_hook_description/meshes/cart/Cylinder_003.stl
Binary file not shown.
Binary file added mir_hook_description/meshes/cart/Part__Feature.stl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added mir_hook_description/meshes/hook/carriage.stl
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file added mir_hook_description/meshes/hook/fork_base.stl
Diff not rendered.
Binary file added mir_hook_description/meshes/hook/frame.stl
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file added mir_hook_description/meshes/hook/pan_motor.stl
Diff not rendered.
Diff not rendered.
15 changes: 15 additions & 0 deletions mir_hook_description/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<package format="2">
<name>mir_hook_description</name>
<version>1.0.7</version>
<description>URDF description of the MiR100 robot with hook and cart</description>

<maintainer email="[email protected]">Dennis Mronga</maintainer>
<author email="[email protected]">Dennis Mronga</author>

<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>

<exec_depend>mir_description</exec_depend>
</package>
10 changes: 10 additions & 0 deletions mir_hook_description/urdf/config/gazebo_ros_control_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gazebo_ros_control:
pid_gains:
Pan_Axis:
p: 1
i: 1
d: 1
Tilt_Axis:
p: 1
i: 1
d: 1
Loading