Skip to content

Commit

Permalink
Adding new world
Browse files Browse the repository at this point in the history
Added world and models

Big changes,added launch file, apriltag on create robot, erased to cameras, cleaned the world file

Changed the apriltags and camera plugin

fixup! Adding new world

Change apriltags for improve the visualization

Added in launch file apriltag and tf_state nodes
  • Loading branch information
stevendes committed Oct 28, 2019
1 parent 3c5e68f commit 9c0df02
Show file tree
Hide file tree
Showing 20 changed files with 667 additions and 0 deletions.
37 changes: 37 additions & 0 deletions ca_description/urdf/create_apriltag.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" ?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">

<xacro:macro name="create_apriltag" params="parent *origin">
<joint name="apriltag_joint" type="fixed">
<xacro:insert_block name='origin' />
<parent link="${parent}" />
<child link="apriltag_link" />
</joint>

<link name="apriltag_link">
<visual>
<geometry>
<box size="0.5 0.5 0.01"/>
</geometry>
</visual>
</link>

<gazebo reference="apriltag_link">
<visual>
<material>
<script>
<uri>model://camera_world/apriltag3/materials/scripts/textures.material</uri>
<uri>model://camera_world/apriltag3/materials/textures/apriltag3.png</uri>
<name>apriltag3</name>
</script>-
<ambient>1 1 1 1</ambient>
<diffuse>1 1 1 1</diffuse>
<specular>1 1 1 1</specular>
<emissive>1 1 1 1</emissive>
</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 @@ -9,6 +9,7 @@
<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"/>
<xacro:include filename="$(find ca_description)/urdf/create_apriltag.xacro"/>

<xacro:property name="base_link_offset_z" value="0.0308"/>
<xacro:property name="base_offset_z" value="0.017"/>
Expand Down Expand Up @@ -50,6 +51,11 @@
<origin xyz="0 -0.04 0.13" rpy="0 0 0"/>
</xacro:imu_sensor>

<xacro:create_apriltag parent="base_link">
<origin xyz="0 0 0.25" rpy="0 0 0"/>
</xacro:create_apriltag>


<xacro:create_wheel prefix="left" y_offset="${wheel_separation / 2}" wheel_radius="${wheel_radius}" wheel_width="${wheel_width}"/>
<xacro:create_wheel prefix="right" y_offset="${wheel_separation / -2}" wheel_radius="${wheel_radius}" wheel_width="${wheel_width}"/>
<xacro:caster_wheel/>
Expand Down
19 changes: 19 additions & 0 deletions ca_gazebo/launch/create_camera_world.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<launch>
<param name="create1/amcl/initial_pose_x" value="0"/>
<param name="create1/amcl/initial_pose_y" value="4"/>
<param name="create1/amcl/initial_pose_a" value="0"/>

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

<node pkg="tf" type="static_transform_publisher" name="camera_link_tf" args="0 4 15 0 3.1416 0 map camera_link 50" />

<include file="$(find apriltag_ros)/launch/continuous_detection.launch">
<arg name="camera_name" value="camera_world/camera1"/>
<arg name="camera_frame" value="camera_link"/>
<arg name="image_topic" value="apriltag_tracking_camera"/>
</include>

</launch>

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
material apriltag1
{
technique
{
pass
{
texture_unit
{
texture apriltag1.png
scale 1 1
}
}
}
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions ca_gazebo/models/camera_world/apriltag1/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<model>
<name>apriltag1</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Steven Desvars</name>
<email>[email protected]</email>
</author>
<description>SDF model for apriltag1</description>
</model>
34 changes: 34 additions & 0 deletions ca_gazebo/models/camera_world/apriltag1/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='apriltag1'>
<static>1</static>
<link name="box">
<pose frame=''>0 0 0 0 0 0</pose>
<collision name="collision">
<geometry>
<box>
<size>0.5 0.5 0.01</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>0.5 0.5 0.01</size>
</box>
</geometry>
<material>
<script>
<uri>model://camera_world/apriltag1/materials/scripts </uri>
<uri>model://camera_world/apriltag1/materials/textures </uri>
<name>apriltag1</name>
</script>
<ambient>1 1 1 1</ambient>
<diffuse>1 1 1 1</diffuse>
<specular>1 1 1 1</specular>
<emissive>1 1 1 1</emissive>
</material>
</visual>
</link>
</model>
</sdf>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
material apriltag2
{
technique
{
pass
{
texture_unit
{
texture apriltag2.png
scale 1 1
}
}
}
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions ca_gazebo/models/camera_world/apriltag2/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<model>
<name>apriltag2</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Steven Desvars</name>
<email>[email protected]</email>
</author>
<description>SDF model for apriltag2</description>
</model>
34 changes: 34 additions & 0 deletions ca_gazebo/models/camera_world/apriltag2/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='apriltag2'>
<static>1</static>
<link name="box">
<pose frame=''>0 0 0 0 0 0</pose>
<collision name="collision">
<geometry>
<box>
<size>0.5 0.5 0.01</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>0.5 0.5 0.01</size>
</box>
</geometry>
<material>
<script>
<uri>model://camera_world/apriltag2/materials/scripts </uri>
<uri>model://camera_world/apriltag2/materials/textures </uri>
<name>apriltag2</name>
</script>
<ambient>1 1 1 1</ambient>
<diffuse>1 1 1 1</diffuse>
<specular>1 1 1 1</specular>
<emissive>1 1 1 1</emissive>
</material>
</visual>
</link>
</model>
</sdf>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
material apriltag3
{
technique
{
pass
{
texture_unit
{
texture apriltag3.png
scale 1 1
}
}
}
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions ca_gazebo/models/camera_world/apriltag3/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<model>
<name>apriltag3</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Steven Desvars</name>
<email>[email protected]</email>
</author>
<description>SDF model for apriltag3</description>
</model>
11 changes: 11 additions & 0 deletions ca_gazebo/models/camera_world/camera/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<model>
<name>camera</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Steven Desvars</name>
<email>[email protected]</email>
</author>
<description>SDF model for camera</description>
</model>
58 changes: 58 additions & 0 deletions ca_gazebo/models/camera_world/camera/model.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='camera'>
<static>1</static>
<link name='camera_link'>
<visual name='visual'>
<geometry>
<box>
<size>0.1 0.1 0.1</size>
</box>
</geometry>
</visual>
<sensor type="camera" name="camera1">
<update_rate>30.0</update_rate>
<camera name="head">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>800</width>
<height>800</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.007</stddev>
</noise>
</camera>
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
<updateRate>60.0</updateRate>
<cameraName>camera_world/camera1</cameraName>
<imageTopicName>apriltag_tracking_camera</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>

<joint name="camera_optical_joint" type="fixed">
<parent>camera_link</parent>
<child>camera_optical_frame</child>
<pose frame=''>0 0 0 0 1.57 0</pose>
</joint>

<link name="camera_optical_frame"/>

</model>
</sdf>
16 changes: 16 additions & 0 deletions ca_gazebo/models/camera_world/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>

<model>
<name>camera_world</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name></name>
<email></email>
</author>

<description>
Dummy config file to avoid a warning message
</description>
</model>

11 changes: 11 additions & 0 deletions ca_gazebo/models/camera_world/walls/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<model>
<name>walls</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name>Steven Desvars</name>
<email>[email protected]</email>
</author>
<description>Walls necessary to create an square room</description>
</model>
Loading

0 comments on commit 9c0df02

Please sign in to comment.