Commit c6601c74 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Merge branch 'semaphores' into 'master'

Add inverted alvar png/dae. Update sign, semaphore, localization_sign xacros...

See merge request !3
parents c17b0509 186f30ea
......@@ -30,51 +30,38 @@ catkin_make
## Launch
This package file includes a launch file named spawn_sign.launch which is intended to be included from other launch file that requires to spawn traffic signs in a simulated Gazebo world. This launch file has the following parameters:
* **name**: (default=stop1) name given to the traffic sign used to to name the nodes and topics associated with the sign description.
* **model**: (default=sign) URDF model to use. At the moment only static traffic signs are supported.
* **tag**: (default=alvar0) Name of the Alvar AR tag used to identify the traffic sign.
* **type**: (default=stop) Type of the traffic sign. The currently supported types are:
* giveway
* haveway
* max_100
* max_50
* no_entry
* no_overtaking
* one_way
* parking
* pedestrian_crossing
* roadworks
* roundabout
* stop
* unmarked_intersection
* ahead_only
* turn_left
* turn_right
* **x** (default=0.0) x position where the traffic sign will placed in the simulated environment with respect to the parent frame.
* **y** (default=0.0) y position where the traffic sign will placed in the simulated environment with respect to the parent frame.
* **yaw** (default=0.0) orientation of the traffic sign with respect to the parent frame.
* **parent** (default=map) parent reference frame used to place the traffic sign in the simulated environment.
To spawn a traffic sign from an other launch file, include the following lines:
```
<include file="$(find iri_sign_description)/launch/spawn_sign.launch">
<arg name="name" value="$(arg name)"/>
<arg name="model" value="$(arg model)"/>
<arg name="tag" value="$(arg tag)"/>
<arg name="type" value="$(arg type)"/>
<arg name="x" value="$(arg x)"/>
<arg name="y" value="$(arg y)"/>
<arg name="yaw" value="$(arg yaw)"/>
<arg name="parent" value="$(arg parent)"/>
</include>
```
A test launch file is provided to visualize the traffic sign in RVIZ. To use it, execute the following command:
This package file includes launch files:
* spawn_sign.launch to spawn traffic signs in a simulated Gazebo world. This launch file has the following parameters:
* **name**: (default=stop1) name given to the traffic sign used to to name the nodes and topics associated with the sign description.
* **model**: (default=sign) URDF model to use. At the moment only static traffic signs are supported.
* **tag**: (default=alvar0) Name of the Alvar AR tag used to identify the traffic sign.
* **type**: (default=stop) Type of the traffic sign. The currently supported types are: giveway, haveway, max_100, max_50, no_entry, no_overtaking, one_way, parking, pedestrian_crossing, roadworks, roundabout, stop, unmarked_intersection, ahead_only, turn_left, turn_right
* **x** (default=0.0) x position where the traffic sign will placed in the simulated environment with respect to the parent frame.
* **y** (default=0.0) y position where the traffic sign will placed in the simulated environment with respect to the parent frame.
* **yaw** (default=0.0) orientation of the traffic sign with respect to the parent frame.
* **parent** (default=map) parent reference frame used to place the traffic sign in the simulated environment.
* spawn_semaphore.launch to spawn a traffic light in a simulated Gazebo world. This launch file has the following parameters:
* **name**: (default=semaphore) name given to the traffic sign used to to name the nodes and topics associated with the sign description.
* **model**: (default=semaphore) URDF model to use.
* **tag**: (default=alvar0_negative) Name of the Alvar AR tag used to identify the traffic sign.
* **initial_state**: (default=False). Initial state of the light. False=Green, True=Red.
* **x** (default=0.0) x position where the traffic sign will placed in the simulated environment with respect to the parent frame.
* **y** (default=0.0) y position where the traffic sign will placed in the simulated environment with respect to the parent frame.
* **yaw** (default=0.0) orientation of the traffic sign with respect to the parent frame.
* **parent** (default=map) parent reference frame used to place the traffic sign in the simulated environment.
* To change the semaphore light, publish on the /<name>_set_material_plugin/set_material topic.
* An empty string will make the light to switch between green and red
* Setting a [gazebo material](http://wiki.ros.org/simulator_gazebo/Tutorials/ListOfMaterials) (Gazebo/Red, Gazebo/Green, Gazebo/Orange, ...) will change the material accordingly.
* spawn_localization_sign.launch. Under development.
A test launch file is provided. To use it, execute the following command:
```
roslaunch iri_sign_description spawn_test.launch
rostopic pub -1 /semaphore1_set_material_plugin/set_material std_msgs/String "data: ''"
rostopic pub -1 /semaphore2_set_material_plugin/set_material std_msgs/String "data: 'Gazebo/Orange'"
```
## Disclaimer
......
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="name" default="loc_sign"/>
<arg name="model" default="loc_sign"/>
<arg name="tag" default="alvar2_neg_1"/>
<arg name="x" default="0.5"/>
<arg name="y" default="-0.5"/>
<arg name="yaw" default="3.14159"/>
<arg name="parent" default="map"/>
<param name="$(arg name)_description"
command="$(find xacro)/xacro '$(find iri_sign_description)/urdf/$(arg model).xacro'
name:=$(arg name)
tag:=$(arg tag)">
</param>
<node name="$(arg name)_state_publisher"
pkg ="robot_state_publisher"
type="robot_state_publisher">
<!--<param name="tf_prefix" value="/$(arg name)" type="str" />-->
<remap from="robot_description" to="$(arg name)_description" />
<remap from="/joint_states" to="/$(arg name)/joint_states" />
</node>
<node name="spawn_urdf_$(arg name)"
pkg ="gazebo_ros"
type="spawn_model"
args="-param /$(arg name)_description -urdf -model $(arg name) -x $(arg x) -y $(arg y) -z 0 -Y $(arg yaw)">
</node>
<node name="static_tf_$(arg name)_base_link_to_$(arg parent)" pkg="tf" type="static_transform_publisher"
args="$(arg x) $(arg y) 0 $(arg yaw) 0 0 $(arg parent) $(arg name)_base_link 100">
</node>
</launch>
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="name" default="semaphore"/>
<arg name="model" default="semaphore"/>
<arg name="tag" default="alvar0_neg_1"/>
<arg name="initial_state" default="False"/>
<arg name="x" default="0.5"/>
<arg name="y" default="-0.5"/>
<arg name="yaw" default="3.14159"/>
<arg name="parent" default="map"/>
<param name="$(arg name)_description"
command="$(find xacro)/xacro '$(find iri_sign_description)/urdf/$(arg model).xacro'
name:=$(arg name)
tag:=$(arg tag)
initial_state:=$(arg initial_state)">
</param>
<node name="$(arg name)_state_publisher"
pkg ="robot_state_publisher"
type="robot_state_publisher">
<!--<param name="tf_prefix" value="/$(arg name)" type="str" />-->
<remap from="robot_description" to="$(arg name)_description" />
<remap from="/joint_states" to="/$(arg name)/joint_states" />
</node>
<node name="spawn_urdf_$(arg name)"
pkg ="gazebo_ros"
type="spawn_model"
args="-param /$(arg name)_description -urdf -model $(arg name) -x $(arg x) -y $(arg y) -z 0 -Y $(arg yaw)">
</node>
<node name="static_tf_$(arg name)_base_link_to_$(arg parent)" pkg="tf" type="static_transform_publisher"
args="$(arg x) $(arg y) 0 $(arg yaw) 0 0 $(arg parent) $(arg name)_base_link 100">
</node>
</launch>
......@@ -2,7 +2,7 @@
<launch>
<arg name="name" default="stop"/>
<arg name="model" default="sign"/>
<arg name="tag" default="alvar0"/>
<arg name="tag" default="alvar1_neg_1"/>
<arg name="type" default="stop"/>
<arg name="x" default="0.5"/>
<arg name="y" default="-0.5"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<launch>
<arg name="name" default="stop1"/>
<arg name="model" default="sign"/>
<arg name="tag" default="alvar0"/>
<arg name="type" default="stop"/>
<arg name="x" default="0.5"/>
<arg name="y" default="-0.5"/>
<arg name="yaw" default="3.14159"/>
<arg name="gazebo" default="true"/>
<arg name="parent" default="map"/>
<arg name="world_name" default="worlds/empty.world"/>
<arg name="gui" default="true"/>
<group if="$(arg gazebo)">
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world_name)"/>
<arg name="gui" value="$(arg gui)"/>
</include>
</group>
<include file="$(find iri_sign_description)/launch/spawn_semaphore.launch">
<arg name="name" value="semaphore1"/>
<arg name="initial_state" value="false"/>
<arg name="x" value="0.7"/>
<arg name="y" value="0.1"/>
<arg name="yaw" value="3.14159"/>
<arg name="parent" value="$(arg parent)"/>
</include>
<include file="$(find iri_sign_description)/launch/spawn_semaphore.launch">
<arg name="name" value="semaphore2"/>
<arg name="initial_state" value="true"/>
<arg name="x" value="0.7"/>
<arg name="y" value="-0.1"/>
<arg name="yaw" value="3.14159"/>
<arg name="parent" value="$(arg parent)"/>
</include>
<include file="$(find iri_sign_description)/launch/spawn_sign.launch">
<arg name="name" value="$(arg name)"/>
<arg name="model" value="$(arg model)"/>
<arg name="tag" value="$(arg tag)"/>
<arg name="type" value="$(arg type)"/>
<arg name="x" value="$(arg x)"/>
<arg name="y" value="$(arg y)"/>
<arg name="yaw" value="$(arg yaw)"/>
<arg name="parent" value="$(arg parent)"/>
<arg name="name" value="sign1"/>
<arg name="type" value="stop"/>
<arg name="x" value="0.7"/>
<arg name="y" value="-0.3"/>
<arg name="yaw" value="3.14159"/>
<arg name="parent" value="$(arg parent)"/>
</include>
<include file="$(find iri_sign_description)/launch/spawn_sign.launch">
<arg name="name" value="sign2"/>
<arg name="type" value="parking"/>
<arg name="x" value="0.7"/>
<arg name="y" value="-0.5"/>
<arg name="yaw" value="3.14159"/>
<arg name="parent" value="$(arg parent)"/>
</include>
<include file="$(find iri_sign_description)/launch/spawn_localization_sign.launch">
<arg name="name" value="locsign1"/>
<arg name="x" value="0.7"/>
<arg name="y" value="0.3"/>
<arg name="yaw" value="3.14159"/>
<arg name="parent" value="$(arg parent)"/>
</include>
<include file="$(find iri_sign_description)/launch/spawn_sign.launch">
<arg name="name" value="unique_loc_sign1"/>
<arg name="type" value="world_negative"/>
<arg name="tag" value="alvar3_neg_1"/>
<arg name="x" value="0.7"/>
<arg name="y" value="0.5"/>
<arg name="yaw" value="3.14159"/>
<arg name="parent" value="$(arg parent)"/>
</include>
<node name="$(arg name)_rviz" pkg="rviz" type="rviz"
args="-d $(find iri_sign_description)/rviz/$(arg name).rviz"/>
</launch>
This diff is collapsed.
File added
......@@ -45,6 +45,7 @@
<run_depend>robot_state_publisher</run_depend>
<run_depend>gazebo_ros</run_depend>
<run_depend>iri_gazebo_set_material_plugin</run_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
......
<?xml version="1.0"?>
<robot name="$(arg name)" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find iri_sign_description)/urdf/signs/localization_sign_macro.xacro" />
<xacro:localization_sign name="$(arg name)"
tag_dae="$(arg tag)">
</xacro:localization_sign>
</robot>
<?xml version="1.0"?>
<robot name="$(arg name)" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find iri_sign_description)/urdf/signs/semaphore_macro.xacro" />
<xacro:semaphore name="$(arg name)"
tag_dae="$(arg tag)"
initial_state="$(arg initial_state)">
</xacro:semaphore>
</robot>
<?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/alvar0_neg_1.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 0 0 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/alvar0_negative.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 0 0 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"/>