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
1 change: 1 addition & 0 deletions ca_description/launch/create_description.launch
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<launch>

<arg name="model" default="$(find ca_description)/urdf/create_2.xacro"/>

<arg name="robot_name" default="create"/>
Expand Down
34 changes: 34 additions & 0 deletions ca_description/urdf/april_tag.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" ?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">

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

<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?

<geometry>
<box size="0.5 0.5 0.05" />
</geometry>
</visual>
</link>

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

<gazebo reference="${name_prefix}_april_tag_link">
<visual>
<material>
<script>
<uri>model://create_april_tags/materials/scripts </uri>
<uri>model://create_april_tags/materials/textures </uri>
<name>AprilTag5</name>
</script>
</material>
</visual>
</gazebo>

</xacro:macro>

</robot>
6 changes: 6 additions & 0 deletions ca_description/urdf/create_base.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<xacro:include filename="$(find ca_description)/urdf/create_base_gazebo.xacro"/>
<xacro:include filename="$(find ca_description)/urdf/create_caster_wheel.xacro"/>
<xacro:include filename="$(find ca_description)/urdf/create_wheel.xacro"/>
<xacro:include filename="$(find ca_description)/urdf/april_tag.xacro"/>
<xacro:include filename="$(find ca_description)/urdf/sensors/imu_sensor.xacro"/>
<xacro:include filename="$(find ca_description)/urdf/sensors/wall_sensor.xacro"/>
<xacro:include filename="$(find ca_description)/urdf/sensors/cliff_sensors.xacro"/>
Expand Down Expand Up @@ -54,7 +55,12 @@
<xacro:create_wheel prefix="right" y_offset="${wheel_separation / -2}" wheel_radius="${wheel_radius}" wheel_width="${wheel_width}"/>
<xacro:caster_wheel/>

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

<!-- Simulation sensors -->
<xacro:sim_create_base/>

</xacro:macro>
</robot>
14 changes: 14 additions & 0 deletions ca_gazebo/launch/create_april_tags.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<launch>
<arg name="env" default="april_tags"/>
<param name="create1/amcl/initial_pose_x" value="3"/>
<param name="create1/amcl/initial_pose_y" value="3"/>
<param name="create1/amcl/initial_pose_a" value="1"/>

<include file="$(find ca_gazebo)/launch/create_empty_world.launch">
<arg name="env" value="april_tags"/>
</include>

<node pkg="tf" type="static_transform_publisher" name="camera_link_broadcaster" args="0 0 16 3.14159 3.14159 0 map camera_link 20" />
<include file="$(find apriltag_ros)/launch/continuous_detection.launch"/>

</launch>
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
@@ -0,0 +1,83 @@
material AprilTag0
{
technique
{
pass
{
texture_unit
{
texture apriltag0.png
}
}
}
}

material AprilTag1
{
technique
{
pass
{
texture_unit
{
texture apriltag1.png
}
}
}
}

material AprilTag2
{
technique
{
pass
{
texture_unit
{
texture apriltag2.png
}
}
}
}

material AprilTag3
{
technique
{
pass
{
texture_unit
{
texture apriltag3.png
}
}
}
}

material AprilTag4
{
technique
{
pass
{
texture_unit
{
texture apriltag4.png
}
}
}
}

material AprilTag5
{
technique
{
pass
{
texture_unit
{
texture apriltag5.png
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions ca_gazebo/models/create_april_tags/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" ?>
<model>
<name>Lucas S. april tags assignment house</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Lucas</name>
<email>[email protected]</email>
</author>
<description>April tags environment</description>
<models>
<uri>model://create_april_tags</uri>
</models>
</model>
92 changes: 92 additions & 0 deletions ca_gazebo/models/create_april_tags/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='create_april_tags'>
<static>1</static>

<link name='AprilTag1'>
<pose>4 4 0 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag1_Visual'>
<geometry>
<box>
<size>0.5 0.5 0.05 </size>
</box>
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts </uri>
<uri>model://create_april_tags/materials/textures </uri>
<name>AprilTag1</name>
</script>
</material>
<cast_shadows>1</cast_shadows>
<transparency>0</transparency>
</visual>
</link>

<link name='AprilTag2'>
<pose>4 -4 0 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag2_Visual'>
<geometry>
<box>
<size>0.5 0.5 0.05 </size>
</box>
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts/create_april_tags.material </uri>
<name>AprilTag2</name>
</script>
</material>
<cast_shadows>1</cast_shadows>
<transparency>0</transparency>
</visual>
</link>

<link name='AprilTag3'>
<pose>-4 4 0 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag3_Visual'>
<geometry>
<box>
<size>0.5 0.5 0.05 </size>
</box>
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts/create_april_tags.material </uri>
<name>AprilTag3</name>
</script>
</material>
<cast_shadows>1</cast_shadows>
<transparency>0</transparency>
</visual>
</link>

<link name='AprilTag4'>
<pose>-4 -4 0 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag4_Visual'>
<geometry>
<box>
<size>0.5 0.5 0.05 </size>
</box>
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts/create_april_tags.material </uri>
<name>AprilTag4</name>
</script>
</material>
<cast_shadows>1</cast_shadows>
<transparency>0</transparency>
</visual>
</link>

</model>
</sdf>
10 changes: 10 additions & 0 deletions ca_gazebo/models/create_camera/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" ?>
<model>
<name>Lucas S. camera</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<description></description>
<models>
<uri>model://camera</uri>
</models>
</model>
44 changes: 44 additions & 0 deletions ca_gazebo/models/create_camera/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='camera'>
<static>true</static>
<link name='camera_link'>
<visual name='visual'>
<geometry>
<box>
<size>0.1 0.1 0.1</size>
</box>
</geometry>
</visual>
<sensor name='apriltag_camera' type='camera'>
<camera>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>480</width>
<height>270</height>
</image>
<clip>
<near>0.1</near>
<far>50</far>
</clip>
</camera>
<always_on>1</always_on>
<update_rate>50</update_rate>
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
<updateRate>30</updateRate>
<cameraName>/apriltag_camera</cameraName>
<imageTopicName>camera_output_image</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera_link</frameName>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
</plugin>
</sensor>
</link>
</model>
</sdf>
10 changes: 10 additions & 0 deletions ca_gazebo/models/create_four_walls/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" ?>
<model>
<name>Lucas S. four walls</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<description></description>
<models>
<uri>model://create_four_walls</uri>
</models>
</model>
Loading