Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 36 additions & 0 deletions ca_description/urdf/april_tag.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" ?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">

<xacro:macro name="april_tag">

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

<link name="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">
<parent link="base_link" />
<child link="april_tag_link"/>
</joint>

<gazebo reference="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>
4 changes: 4 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,10 @@
<xacro:create_wheel prefix="right" y_offset="${wheel_separation / -2}" wheel_radius="${wheel_radius}" wheel_width="${wheel_width}"/>
<xacro:caster_wheel/>

<xacro:april_tag/>

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

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

<param name="create2/amcl/initial_pose_x" value="0"/>
<param name="create2/amcl/initial_pose_y" value="0"/>
<param name="create2/amcl/initial_pose_a" value="0"/>

<arg name="paused" value="$(optenv PAUSED false)"/>
<arg name="gui" value="$(optenv GUI true)"/>
<arg name="debug" value="$(optenv DEBUG false)"/>

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

<!-- Launch Gazebo world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="debug" value="$(arg debug)" />
<arg name="gui" value="$(arg gui)" />
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="true"/>
<arg name="verbose" value="true"/>
<arg name="world_name" value="$(find ca_gazebo)/worlds/$(arg env).world"/>
</include>

<!-- Spawn robot/s -->
<include file="$(find ca_gazebo)/launch/spawn_multirobot.launch"/>

<!-- map_server -->
<include file="$(find ca_move_base)/launch/map_server.launch">
<arg name="env" value="$(arg env)"/>
</include>

<!-- publish the image -->

</launch>
107 changes: 107 additions & 0 deletions ca_gazebo/models/create_april_tags/materials/scripts/apriltag.material
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
material AprilTag0
{
technique
{
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
}
}
}
}

material AprilTag1
{
technique
{
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
}
}
}
}

material AprilTag2
{
technique
{
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
}
}
}
}

material AprilTag3
{
technique
{
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
}
}
}
}

material AprilTag4
{
technique
{
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
}
}
}
}

material AprilTag5
{
technique
{
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
}
}
}
}
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.
10 changes: 10 additions & 0 deletions ca_gazebo/models/create_april_tags/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" ?>
<model>
<name>Lucas S. april tags assignment house</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<description></description>
<models>
<uri>model://create_april_tags</uri>
</models>
</model>
98 changes: 98 additions & 0 deletions ca_gazebo/models/create_april_tags/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='create_april_tags'>
<static>1</static>

<link name='AprilTag1'>
<pose frame=''>9.0 9.0 -1.2 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag1_Visual'>
<pose frame=''>0 0 1.25 0 -0 0</pose>
<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 frame=''>-9.0 -9.0 -1.2 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag2_Visual'>
<pose frame=''>0 0 1.25 0 -0 0</pose>
<geometry>
<box>
<size>0.5 0.5 0.05 </size>
</box>
</geometry>
<material>
<script>
<uri>model://create_april_tags/materials/scripts/apriltag.material </uri>
<name>AprilTag2</name>
</script>
</material>
<cast_shadows>1</cast_shadows>
<transparency>0</transparency>
</visual>
</link>

<link name='AprilTag3'>
<pose frame=''>-9.0 9.0 -1.2 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag3_Visual'>
<pose frame=''>0 0 1.25 0 -0 0</pose>
<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>AprilTag3</name>
</script>
</material>
<cast_shadows>1</cast_shadows>
<transparency>0</transparency>
</visual>
</link>

<link name='AprilTag4'>
<pose frame=''>9.0 -9.0 -1.2 0 0 0</pose>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<visual name='AprilTag4_Visual'>
<pose frame=''>0 0 1.25 0 -0 0</pose>
<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>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>
49 changes: 49 additions & 0 deletions ca_gazebo/models/create_camera/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='camera'>
<static>true</static>
<link name='link'>
<visual name='visual'>
<geometry>
<box>
<size>0.1 0.1 0.1</size>
</box>
</geometry>
</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>
<height>3240</height>
</image>
<clip>
<near>0.1</near>
<far>500</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>0.0</updateRate>
<cameraName>/apriltag_camera</cameraName>
<imageTopicName>image_raw</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