Skip to content

Lucas S. files for the April tags environment #107

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

Open
wants to merge 10 commits into
base: kinetic-devel
Choose a base branch
from
14 changes: 6 additions & 8 deletions ca_description/urdf/april_tag.xacro
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<?xml version="1.0" ?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">

<xacro:macro name="april_tag">
<xacro:macro name="april_tag" params="name_prefix *origin">

<xacro:property name="april_tag_z_offset" value="0.3"/>

<link name="april_tag_link">
<link name="${name_prefix}_april_tag_link">
<visual>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized about this. Is the visual tag mandatory? Since you only want to apply a texture, do you need to create this visual block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I delete this, the Apriltag doesn't appear. This xacro corresponds to the Apriltag of the robot.
How can a texture be applied if there is no visual object to apply it to?

<origin xyz=" 0 0 ${april_tag_z_offset}" rpy="0 0 0" />
<geometry>
<box size="0.5 0.5 0.05" />
</geometry>
</visual>
</link>

<joint name="april_tag_joint" type="fixed">
<joint name="${name_prefix}_april_tag_joint" type="fixed">
<parent link="base_link" />
<child link="april_tag_link"/>
<child link="${name_prefix}_april_tag_link"/>
<xacro:insert_block name="origin"/>
</joint>

<gazebo reference="april_tag_link">
<gazebo reference="${name_prefix}_april_tag_link">
<visual>
<material>
<script>
Expand Down
4 changes: 3 additions & 1 deletion ca_description/urdf/create_base.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
<xacro:create_wheel prefix="right" y_offset="${wheel_separation / -2}" wheel_radius="${wheel_radius}" wheel_width="${wheel_width}"/>
<xacro:caster_wheel/>

<xacro:april_tag/>
<xacro:april_tag name_prefix="create1">
<origin xyz=" 0 0 0.3" rpy="0 0 0" />
</xacro:april_tag>

<!-- Simulation sensors -->
<xacro:sim_create_base/>
Expand Down
2 changes: 0 additions & 2 deletions ca_gazebo/launch/create_april_tags.launch
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<param name="create2/amcl/initial_pose_x" value="-5"/>
<param name="create2/amcl/initial_pose_y" value="-5"/>
<param name="create2/amcl/initial_pose_a" value="1"/>

<env name="GAZEBO_MODEL_PATH" value="$(find ca_gazebo)/models"/>

<include file="$(find ca_gazebo)/launch/create_empty_world.launch">
<arg name="env" value="april_tags"/>
Expand Down
5 changes: 5 additions & 0 deletions ca_gazebo/models/create_april_tags/materials/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" ?>
<model>
<name>Config file for not having 'missing .config file' issue.</name>
<version>1.0</version>
</model>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ material AprilTag0
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 1.0 1.0 1.0 1.0
specular 1.0 1.0 1.0 1.0 12.5

texture_unit
{
texture apriltag0.png
Expand All @@ -22,10 +18,6 @@ material AprilTag1
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 1.0 1.0 1.0 1.0
specular 1.0 1.0 1.0 1.0 12.5

texture_unit
{
texture apriltag1.png
Expand All @@ -40,10 +32,6 @@ material AprilTag2
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 1.0 1.0 1.0 1.0
specular 1.0 1.0 1.0 1.0 12.5

texture_unit
{
texture apriltag2.png
Expand All @@ -58,10 +46,6 @@ material AprilTag3
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 1.0 1.0 1.0 1.0
specular 1.0 1.0 1.0 1.0 12.5

texture_unit
{
texture apriltag3.png
Expand All @@ -76,10 +60,6 @@ material AprilTag4
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 1.0 1.0 1.0 1.0
specular 1.0 1.0 1.0 1.0 12.5

texture_unit
{
texture apriltag4.png
Expand All @@ -94,10 +74,6 @@ material AprilTag5
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 1.0 1.0 1.0 1.0
specular 1.0 1.0 1.0 1.0 12.5

texture_unit
{
texture apriltag5.png
Expand Down
6 changes: 5 additions & 1 deletion ca_gazebo/models/create_april_tags/model.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<name>Lucas S. april tags assignment house</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<description></description>
<author>
<name>Lucas</name>
<email>[email protected]</email>
</author>
<description>April tags environment</description>
<models>
<uri>model://create_april_tags</uri>
</models>
Expand Down
8 changes: 3 additions & 5 deletions ca_gazebo/models/create_april_tags/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts/apriltag.material </uri>
<uri>model://create_april_tags/materials/scripts/create_april_tags.material </uri>
<name>AprilTag2</name>
</script>
</material>
Expand All @@ -61,8 +61,7 @@
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts </uri>
<uri>model://create_april_tags/materials/textures </uri>
<uri>model://create_april_tags/materials/scripts/create_april_tags.material </uri>
<name>AprilTag3</name>
</script>
</material>
Expand All @@ -84,8 +83,7 @@
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts </uri>
<uri>model://create_april_tags/materials/textures </uri>
<uri>model://create_april_tags/materials/scripts/create_april_tags.material </uri>
<name>AprilTag4</name>
</script>
</material>
Expand Down
12 changes: 4 additions & 8 deletions ca_gazebo/models/create_camera/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<sdf version='1.6'>
<model name='camera'>
<static>true</static>
<link name='link'>
<link name='camera_link'>
<visual name='visual'>
<geometry>
<box>
Expand All @@ -12,9 +12,7 @@
</visual>
<sensor name='apriltag_camera' type='camera'>
<camera>
<save enabled="false">
<path>/tmp/camera_save_tutorial</path>
</save>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>5760</width>
Expand All @@ -29,9 +27,9 @@
<update_rate>50</update_rate>
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
<updateRate>0.0</updateRate>
<updateRate>30</updateRate>
<cameraName>/apriltag_camera</cameraName>
<imageTopicName>image_raw</imageTopicName>
<imageTopicName>camera_output_image</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera_link</frameName>
<hackBaseline>0.07</hackBaseline>
Expand All @@ -44,6 +42,4 @@
</sensor>
</link>
</model>


</sdf>
</sdf>
2 changes: 1 addition & 1 deletion ca_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<export>
<gazebo_ros gazebo_media_path="${prefix}"/>
<gazebo_ros gazebo_model_path="${prefix}/models:${prefix}/models/create_autorace:${prefix}/models/create_house"/>
<gazebo_ros gazebo_model_path="${prefix}/models:${prefix}/models/create_autorace:${prefix}/models/create_house:${prefix}/models/create_april_tags"/>
<gazebo_ros plugin_path="${prefix}/lib:${prefix}/models/create_autorace/gazebo_traffic_plugin"/>
</export>
</package>
4 changes: 2 additions & 2 deletions ca_gazebo/worlds/empty.world
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<sdf version="1.6">
<world name="default">
<!-- A global light source -->
<--include>
<include>
<uri>model://sun</uri>
</include>

Expand All @@ -14,7 +14,7 @@
<physics type="ode">
<real_time_update_rate>1000.0</real_time_update_rate>
<max_step_size>0.001</max_step_size>
<real_time_factor>10</real_time_factor>
<real_time_factor>1</real_time_factor>
<ode>
<solver>
<type>quick</type>
Expand Down