Skip to content

Commit

Permalink
Dock model created
Browse files Browse the repository at this point in the history
  • Loading branch information
jlurgo committed Jan 17, 2020
1 parent 35375d8 commit 85275d2
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ca_description/launch/spawn_dock.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<launch>
<arg name="name" default="dock"/>
<!-- Load the URDF into the ROS Parameter Server -->
<param name="dock_description"
command="$(find xacro)/xacro --inorder '$(find ca_description)/urdf/dock/dock.xacro'" />

<!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
<node name="dock_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="
-urdf
-model $(arg name)
-param dock_description
"/>
</launch>
48 changes: 48 additions & 0 deletions ca_description/urdf/dock/dock.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" ?>
<robot name="dock" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="$(find ca_description)/urdf/common_properties.xacro" />
<xacro:macro name="dock" params="width">
<link name='back'>
<visual name='visual'>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="${width} ${width/3} ${width * 2/3}"/>
</geometry>
</visual>
<collision name='collision'>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="${width} ${width/3} ${width * 2/3}"/>
</geometry>
</collision>
<xacro:inertial_cuboid_with_pose mass="0.15" x_length="${width}"
y_length="${width/3}" z_length="${width * 2/3}" >
<origin xyz="0 0 0" />
</xacro:inertial_cuboid_with_pose>
</link>
<link name='base'>
<visual name='visual'>
<origin xyz="0 ${width/2 - width/6} ${-(width * 2/3)/2}" rpy="0 0 0" />
<geometry>
<box size="${width} ${width} 0.01"/>
</geometry>
</visual>
<collision name='collision'>
<origin xyz="0 ${width/2 - width/6} ${-(width * 2/3)/2}" rpy="0 0 0" />
<geometry>
<box size="${width} ${width} 0.01"/>
</geometry>
</collision>
<xacro:inertial_cuboid_with_pose mass="0.05" x_length="${width}"
y_length="${width}" z_length="0.01" >
<origin xyz="0 ${width/2 - width/6} ${-(width * 2/3)/2}" rpy="0 0 0" />
</xacro:inertial_cuboid_with_pose>
</link>
<joint name='glue' type='fixed'>
<parent link="back" />
<child link="base" />
</joint>
</xacro:macro>
<xacro:dock width="0.15">
</xacro:dock>
</robot>
5 changes: 5 additions & 0 deletions ca_gazebo/launch/create_empty_world.launch
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<arg name="localization" value="$(arg localization)" />
</include>

<!-- Spawn dock -->
<include file="$(find ca_description)/launch/spawn_dock.launch">
<arg name="name" value="$(optenv DOCK_NAME dock)" />
</include>

<!-- map_server -->
<include if="$(eval str(arg('localization'))=='amcl')"
file="$(find ca_move_base)/launch/map_server.launch">
Expand Down

0 comments on commit 85275d2

Please sign in to comment.