Skip to content
Snippets Groups Projects
Commit 3d4dcc47 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Added roundabout and stop signals

parent 6e16cc44
No related branches found
No related tags found
No related merge requests found
0 -2.5 -5 2.00
1 0.0 -2.5 2.00
2 0.0 -7.5 2.00
3 -2.5 -5.0 2.00
\ No newline at end of file
0 -2.5 -5 4.00
1 0.0 -2.5 4.00
2 0.0 -7.5 4.00
3 -2.5 -5.0 4.00
\ No newline at end of file
color1_id: green
color1_x: 0.0
color1_y: -2.5
color1_z: 4.0
color2_id: red
color2_x: 2.5
color2_y: -5.0
color2_z: 4.0
color3_id: yellow
color3_x: -2.5
color3_y: -5.0
color3_z: 4.0
color4_id: blue
color4_x: 0.0
color4_y: -7.5
color4_z: 4.0
\ No newline at end of file
......@@ -4,48 +4,35 @@
<xacro:property name="PI" value="3.1415926535897931" />
<xacro:include filename="$(find road_description)/urdf/trafficlight/trafficlight_macro.xacro" />
<xacro:include filename="$(find road_description)/urdf/trafficlight/signal_macro.xacro" />
<xacro:include filename="$(find road_description)/urdf/trafficlight/signal_square_macro.xacro" />
<link name="$(arg parent)">
</link>
<xacro:trafficlight name="semaphore_roundabout1"
parent="$(arg parent)"
tag_dae="alvar0"
light_color="green"
light_material="Gazebo/RedGlow"
light_material2="Gazebo/GreenGlow">
<origin xyz="1.49 -3.64 0" rpy="0 0 ${PI/6}"/>
</xacro:trafficlight>
<xacro:trafficlight name="semaphore_roundabout2"
parent="$(arg parent)"
tag_dae="alvar0"
light_color="red"
light_material="Gazebo/RedGlow"
light_material2="Gazebo/GreenGlow">
<origin xyz="1.96 -5.58 0" rpy="0 0 ${-PI/6}"/>
</xacro:trafficlight>
<xacro:signal_square name="roundabout1"
parent="$(arg parent)"
tag_dae="alvar5"
signal_dae="roundabout">
<origin xyz="1.49 -3.64 0" rpy="0 0 ${PI/6}"/>
</xacro:signal_square>
<xacro:trafficlight name="semaphore_intersection1"
parent="$(arg parent)"
tag_dae="alvar0"
light_color="red"
light_material="Gazebo/RedGlow"
light_material2="Gazebo/GreenGlow">
<origin xyz="-4.55 -5.6 0" rpy="0 0 ${-PI/2}"/>
</xacro:trafficlight>
<xacro:signal_square name="roundabout2"
parent="$(arg parent)"
tag_dae="alvar5"
signal_dae="roundabout">
<origin xyz="1.96 -5.58 0" rpy="0 0 ${-PI/6}"/>
</xacro:signal_square>
<xacro:trafficlight name="semaphore_intersection2"
parent="$(arg parent)"
tag_dae="alvar0"
light_color="red"
light_material="Gazebo/RedGlow"
light_material2="Gazebo/GreenGlow">
<origin xyz="-5.55 -4.6 0" rpy="0 0 ${PI/2}"/>
</xacro:trafficlight>
<xacro:signal_square name="stop1"
parent="$(arg parent)"
tag_dae="alvar6"
signal_dae="stop">
<origin xyz="-3.76 -0.57 0" rpy="0 0 -${PI/4}"/>
</xacro:signal_square>
<xacro:trafficlight name="semaphore_intersection3"
<xacro:trafficlight name="semaphore_intersection1"
parent="$(arg parent)"
tag_dae="alvar0"
light_color="red"
......
road_description/urdf/trafficlight/dae/png/roundabout.png

147 KiB

road_description/urdf/trafficlight/dae/png/stop.png

25.8 KiB

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author></author>
<authoring_tool>FBX COLLADA exporter</authoring_tool>
<comments></comments>
</contributor>
<created>2014-10-05T08:59:28Z</created>
<keywords></keywords>
<modified>2014-10-05T08:59:28Z</modified>
<revision></revision>
<subject></subject>
<title></title>
<unit meter="1.0" name="meter"></unit>
<up_axis>Y_UP</up_axis></asset>
<library_images>
<image id="Map #1-image" name="Map #1">
<init_from>png/roundabout.png</init_from>
</image>
</library_images>
<library_materials>
<material id="Material #36" name="Material #36">
<instance_effect url="#Material #36-fx"/>
</material>
</library_materials>
<library_effects>
<effect id="Material #36-fx" name="Material #36">
<profile_COMMON>
<technique sid="standard">
<phong>
<emission>
<color sid="emission">0.5 0.5 0.5 1</color>
</emission>
<ambient>
<color sid="ambient">1 1 1 1</color>
</ambient>
<diffuse>
<texture texture="Map #1-image" texcoord="CHANNEL0">
<extra>
<technique profile="MAYA">
<wrapU sid="wrapU0">TRUE</wrapU>
<wrapV sid="wrapV0">TRUE</wrapV>
<blend_mode>ADD</blend_mode>
</technique>
</extra>
</texture>
</diffuse>
<specular>
<color sid="specular">0 0 0 1</color>
</specular>
<shininess>
<float sid="shininess">2</float>
</shininess>
<reflective>
<color sid="reflective">0 0 0 1</color>
</reflective>
<reflectivity>
<float sid="reflectivity">1</float>
</reflectivity>
<transparent opaque="RGB_ZERO">
<color sid="transparent">1 1 1 1</color>
</transparent>
<transparency>
<float sid="transparency">0</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="image-lib" name="image">
<mesh>
<source id="image-POSITION">
<float_array id="image-POSITION-array" count="12">
-0.5 -0.5 0
0.5 -0.5 0
-0.5 0.5 0
0.5 0.5 0
</float_array>
<technique_common>
<accessor source="#image-POSITION-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="image-Normal0">
<float_array id="image-Normal0-array" count="18">
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
</float_array>
<technique_common>
<accessor source="#image-Normal0-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="image-UV0">
<float_array id="image-UV0-array" count="8">
0 0
1 0
0 1
1 1
</float_array>
<!--
0.000499 0.000500
0.999500 0.000499
0.000500 0.999501
0.999501 0.999500
-->
<technique_common>
<accessor source="#image-UV0-array" count="4" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="image-VERTEX">
<input semantic="POSITION" source="#image-POSITION"/>
</vertices>
<triangles count="2" material="Material #36">
<input semantic="VERTEX" offset="0" source="#image-VERTEX"/>
<input semantic="NORMAL" offset="1" source="#image-Normal0"/>
<input semantic="TEXCOORD" offset="2" set="0" source="#image-UV0"/>
<p> 0 0 0 1 1 1 3 2 3 3 3 3 2 4 2 0 5 0</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="" name="">
<node name="image" id="image" sid="image">
<matrix sid="matrix">1 0 0 0 0 0 1 0 0 -1 0 0 0 0 0 1</matrix>
<instance_geometry url="#image-lib">
<bind_material>
<technique_common>
<instance_material symbol="Material #36" target="#Material #36"/>
</technique_common>
</bind_material>
</instance_geometry>
<extra>
<technique profile="FCOLLADA">
<visibility>1</visibility>
</technique>
</extra>
</node>
<extra>
<technique profile="MAX3D">
<frame_rate>30</frame_rate>
</technique>
<technique profile="FCOLLADA">
<start_time>0</start_time>
<end_time>3.333333</end_time>
</technique>
</extra>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#"></instance_visual_scene>
</scene>
</COLLADA>
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author></author>
<authoring_tool>FBX COLLADA exporter</authoring_tool>
<comments></comments>
</contributor>
<created>2014-10-05T08:59:28Z</created>
<keywords></keywords>
<modified>2014-10-05T08:59:28Z</modified>
<revision></revision>
<subject></subject>
<title></title>
<unit meter="1.0" name="meter"></unit>
<up_axis>Y_UP</up_axis></asset>
<library_images>
<image id="Map #1-image" name="Map #1">
<init_from>png/stop.png</init_from>
</image>
</library_images>
<library_materials>
<material id="Material #36" name="Material #36">
<instance_effect url="#Material #36-fx"/>
</material>
</library_materials>
<library_effects>
<effect id="Material #36-fx" name="Material #36">
<profile_COMMON>
<technique sid="standard">
<phong>
<emission>
<color sid="emission">0.5 0.5 0.5 1</color>
</emission>
<ambient>
<color sid="ambient">1 1 1 1</color>
</ambient>
<diffuse>
<texture texture="Map #1-image" texcoord="CHANNEL0">
<extra>
<technique profile="MAYA">
<wrapU sid="wrapU0">TRUE</wrapU>
<wrapV sid="wrapV0">TRUE</wrapV>
<blend_mode>ADD</blend_mode>
</technique>
</extra>
</texture>
</diffuse>
<specular>
<color sid="specular">0 0 0 1</color>
</specular>
<shininess>
<float sid="shininess">2</float>
</shininess>
<reflective>
<color sid="reflective">0 0 0 1</color>
</reflective>
<reflectivity>
<float sid="reflectivity">1</float>
</reflectivity>
<transparent opaque="RGB_ZERO">
<color sid="transparent">1 1 1 1</color>
</transparent>
<transparency>
<float sid="transparency">0</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="image-lib" name="image">
<mesh>
<source id="image-POSITION">
<float_array id="image-POSITION-array" count="12">
-0.5 -0.5 0
0.5 -0.5 0
-0.5 0.5 0
0.5 0.5 0
</float_array>
<technique_common>
<accessor source="#image-POSITION-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="image-Normal0">
<float_array id="image-Normal0-array" count="18">
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
</float_array>
<technique_common>
<accessor source="#image-Normal0-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="image-UV0">
<float_array id="image-UV0-array" count="8">
0 0
1 0
0 1
1 1
</float_array>
<!--
0.000499 0.000500
0.999500 0.000499
0.000500 0.999501
0.999501 0.999500
-->
<technique_common>
<accessor source="#image-UV0-array" count="4" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="image-VERTEX">
<input semantic="POSITION" source="#image-POSITION"/>
</vertices>
<triangles count="2" material="Material #36">
<input semantic="VERTEX" offset="0" source="#image-VERTEX"/>
<input semantic="NORMAL" offset="1" source="#image-Normal0"/>
<input semantic="TEXCOORD" offset="2" set="0" source="#image-UV0"/>
<p> 0 0 0 1 1 1 3 2 3 3 3 3 2 4 2 0 5 0</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="" name="">
<node name="image" id="image" sid="image">
<matrix sid="matrix">1 0 0 0 0 0 1 0 0 -1 0 0 0 0 0 1</matrix>
<instance_geometry url="#image-lib">
<bind_material>
<technique_common>
<instance_material symbol="Material #36" target="#Material #36"/>
</technique_common>
</bind_material>
</instance_geometry>
<extra>
<technique profile="FCOLLADA">
<visibility>1</visibility>
</technique>
</extra>
</node>
<extra>
<technique profile="MAX3D">
<frame_rate>30</frame_rate>
</technique>
<technique profile="FCOLLADA">
<start_time>0</start_time>
<end_time>3.333333</end_time>
</technique>
</extra>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#"></instance_visual_scene>
</scene>
</COLLADA>
<?xml version="1.0"?>
<root xmlns:xacro="http://www.ros.org/wiki/xacro">
<!--<xacro:include filename="$(find road_description)/urdf/materials.xacro" />-->
<xacro:property name="PI" value="3.1415926535897931" />
<xacro:property name="panel_width" value="0.07" />
<xacro:property name="panel_depth" value="0.07" />
<xacro:property name="panel_height" value="0.175" />
<xacro:property name="tag_size" value="0.05" />
<xacro:property name="tag_z_offset" value="0.065" />
<xacro:property name="delta" value="0.001" />
<xacro:property name="light_width" value="0.05" />
<xacro:property name="light_height" value="0.05" />
<xacro:property name="light_z_offset" value="0.125" />
<xacro:macro name="signal_square"
params="name:=signal
parent:=${name}_base_link
*origin
tag_dae:=roundabout
signal_dae:=roundabout
light_material2:=Gazebo/GreenGlow
">
<!-- PANEL -->
<joint name="joint_${parent}_to_${name}" type="fixed">
<xacro:insert_block name="origin" />
<parent link="${parent}"/>
<child link="${name}_link"/>
</joint>
<link name="${name}_link">
<inertial>
<mass value="0.001"/>
<origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
<inertia ixx="0.00001" ixy="0.0" ixz="0.0" iyy="0.00001" iyz="0.0" izz="0.00001" />
</inertial>
<visual>
<origin xyz="0 0 ${panel_height/2.0}" rpy="0 0 0"/>
<geometry>
<box size="${panel_depth} ${panel_width} ${panel_height}"/>
</geometry>
<material name="white"/>
</visual>
<collision>
<origin xyz="0 0 ${panel_height/2.0}" rpy="0 0 0"/>
<geometry>
<box size="${panel_depth} ${panel_width} ${panel_height}"/>
</geometry>
</collision>
</link>
<gazebo>
<static>1</static>
</gazebo>
<gazebo reference="${name}_link">
<material>Gazebo/White</material>
</gazebo>
<!-- PANEL -->
<!-- TAG -->
<joint name="joint_${name}_link_to_${name}_tag_link" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="${name}_link"/>
<child link="${name}_tag_link"/>
</joint>
<link name="${name}_tag_link">
</link>
<joint name="joint_${name}_tag_link_to_${name}_tag_image" type="fixed">
<origin xyz="${panel_depth/2.0+delta} 0 ${tag_size/2.0+tag_z_offset}" rpy="0 ${PI} -${PI/2}" />
<parent link="${name}_tag_link"/>
<child link="${name}_tag_image" />
</joint>
<link name="${name}_tag_image">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<mesh filename="package://road_description/urdf/trafficlight/dae/${tag_dae}.dae" scale="${tag_size} 1.0 ${tag_size}"/>
</geometry>
</visual>
</link>
<gazebo>
<static>1</static>
</gazebo>
<gazebo reference="${name}_tag_link">
<material>Gazebo/Black</material>
</gazebo>
<gazebo reference="${name}_tag_image">
</gazebo>
<!-- TAG -->
<!-- LIGHT -->
<joint name="joint_${name}_link_to_${name}_light_link" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="${name}_link"/>
<child link="${name}_light_link"/>
</joint>
<link name="${name}_light_link">
</link>
<joint name="joint_${name}_light_link_to_${name}_light_image" type="fixed">
<origin xyz="${panel_depth/2.0+delta} 0 ${light_height/2.0+light_z_offset}" rpy="0 ${PI} -${PI/2}" />
<parent link="${name}_light_link"/>
<child link="${name}_light_image" />
</joint>
<link name="${name}_light_image">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<mesh filename="package://road_description/urdf/trafficlight/dae/${signal_dae}.dae" scale="${light_width} 1.0 ${light_height}"/>
</geometry>
</visual>
</link>
<gazebo>
<static>1</static>
</gazebo>
<gazebo reference="${name}_light_link">
</gazebo>
<gazebo reference="${name}_light_image">
<!--<material>${light_material}</material>-->
</gazebo>
<!-- LIGHT -->
</xacro:macro>
</root>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment