Skip to content

Commit a961de9

Browse files
authored
Merge branch 'master' into submitted_models/ctu_cras_norlab_absolem_improved
2 parents 37f4e09 + beb30c7 commit a961de9

29 files changed

+52553
-129
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(coro_allie_sensor_config_1)
3+
4+
find_package(catkin REQUIRED)
5+
6+
catkin_package()
7+
8+
install(DIRECTORY launch meshes urdf
9+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
10+
11+
install(FILES model.sdf model.config
12+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0"?>
2+
<launch>
3+
<arg name="name" doc="Name of Vehicle"/>
4+
<param name="$(arg name)/robot_description" command="$(find xacro)/xacro '$(find coro_allie_sensor_config_1)/urdf/model.xacro' name:=$(arg name)"/>
5+
</launch>
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<?xml version="1.0"?>
2+
<!-- Usage: ign launch path/to/example.ign robotName:=<X1>
3+
4+
Parameters:
5+
robotName: Name to be assigned to model
6+
-->
7+
8+
<%
9+
require_relative 'spawner'
10+
11+
# Modify these as needed
12+
$enableGroundTruth = true
13+
$headless = local_variables.include?(:headless) ? :headless : false
14+
15+
%>
16+
17+
<%
18+
19+
unless local_variables.include?(:robotName)
20+
raise "missing parameters. robotName is a required parameter"
21+
end
22+
23+
# This assumes that this launch file is in a directory below the model
24+
modelURI = File.expand_path("../", File.dirname(__FILE__))
25+
$worldName = 'example'
26+
worldFile = File.join(File.expand_path("../worlds", File.dirname(__FILE__)), "#{$worldName}.sdf")
27+
28+
%>
29+
30+
<ignition version='1.0'>
31+
<env>
32+
<name>IGN_GAZEBO_SYSTEM_PLUGIN_PATH</name>
33+
<value>$LD_LIBRARY_PATH</value>
34+
</env>
35+
36+
<!-- Start ROS first. This is a bit hacky for now. -->
37+
<!-- Make sure to source /opt/ros/melodic/setup.bash -->
38+
<executable name='ros'>
39+
<command>roslaunch subt_ros competition_init.launch world_name:=<%=$worldName%> vehicle_topics:=0 enable_ground_truth:=<%=($enableGroundTruth)?"1":"0"%> robot_names:=<%=robotName%></command>
40+
</executable>
41+
42+
<plugin name="ignition::launch::GazeboServer"
43+
filename="libignition-launch-gazebo.so">
44+
<world_file><%= worldFile %></world_file>
45+
<run>true</run>
46+
<levels>false</levels>
47+
<record>
48+
<enabled>false</enabled>
49+
</record>
50+
51+
<plugin entity_name="<%= $worldName %>"
52+
entity_type="world"
53+
filename="libignition-gazebo-physics-system.so"
54+
name="ignition::gazebo::systems::Physics">
55+
</plugin>
56+
57+
<plugin entity_name="<%= $worldName %>"
58+
entity_type="world"
59+
filename="libignition-gazebo-sensors-system.so"
60+
name="ignition::gazebo::systems::Sensors">
61+
<render_engine>ogre2</render_engine>
62+
</plugin>
63+
<plugin entity_name="<%= $worldName %>"
64+
entity_type="world"
65+
filename="libignition-gazebo-user-commands-system.so"
66+
name="ignition::gazebo::systems::UserCommands">
67+
</plugin>
68+
<plugin entity_name="<%= $worldName %>"
69+
entity_type="world"
70+
filename="libignition-gazebo-scene-broadcaster-system.so"
71+
name="ignition::gazebo::systems::SceneBroadcaster">
72+
</plugin>
73+
<plugin entity_name="<%= $worldName %>"
74+
entity_type="world"
75+
filename="libignition-gazebo-imu-system.so"
76+
name="ignition::gazebo::systems::Imu">
77+
</plugin>
78+
79+
<plugin entity_name="<%= $worldName %>"
80+
entity_type="world"
81+
filename="libignition-gazebo-magnetometer-system.so"
82+
name="ignition::gazebo::systems::Magnetometer">
83+
</plugin>
84+
85+
<plugin entity_name="<%= $worldName %>"
86+
entity_type="world"
87+
filename="libignition-gazebo-air-pressure-system.so"
88+
name="ignition::gazebo::systems::AirPressure">
89+
</plugin>
90+
</plugin>
91+
92+
<%if !$headless %>
93+
<executable_wrapper>
94+
<plugin name="ignition::launch::GazeboGui"
95+
filename="libignition-launch-gazebogui.so">
96+
<world_name><%= $worldName %></world_name>
97+
<window_title>SubT Simulator</window_title>
98+
<window_icon><%= ENV['SUBT_IMAGES_PATH'] %>/SubT_logo.svg</window_icon>
99+
<plugin filename="GzScene3D" name="3D View">
100+
<ignition-gui>
101+
<title>3D View</title>
102+
<property type="bool" key="showTitleBar">false</property>
103+
<property type="string" key="state">docked</property>
104+
</ignition-gui>
105+
106+
<engine>ogre2</engine>
107+
<scene>scene</scene>
108+
<ambient_light>0.2 0.2 0.1</ambient_light>
109+
<background_color>0.8 0.8 0.8</background_color>
110+
<camera_pose>-6.3 -4.2 3.6 0 0.268 0.304</camera_pose>
111+
<service>/world/<%= $worldName %>/scene/info</service>
112+
<pose_topic>/world/<%= $worldName %>/pose/info</pose_topic>
113+
<scene_topic>/world/<%= $worldName %>/scene/info</scene_topic>
114+
<deletion_topic>/world/<%= $worldName %>/scene/deletion</deletion_topic>
115+
</plugin>
116+
<plugin filename="WorldControl" name="World control">
117+
<ignition-gui>
118+
<title>World control</title>
119+
<property type="bool" key="showTitleBar">false</property>
120+
<property type="bool" key="resizable">false</property>
121+
<property type="double" key="height">72</property>
122+
<property type="double" key="width">121</property>
123+
<property type="double" key="z">1</property>
124+
125+
<property type="string" key="state">floating</property>
126+
<anchors target="3D View">
127+
<line own="left" target="left"/>
128+
<line own="bottom" target="bottom"/>
129+
</anchors>
130+
</ignition-gui>
131+
132+
<play_pause>true</play_pause>
133+
<step>true</step>
134+
<start_paused>true</start_paused>
135+
<service>/world/<%= $worldName %>/control</service>
136+
<stats_topic>/world/<%= $worldName %>/stats</stats_topic>
137+
138+
</plugin>
139+
140+
<plugin filename="WorldStats" name="World stats">
141+
<ignition-gui>
142+
<title>World stats</title>
143+
<property type="bool" key="showTitleBar">false</property>
144+
<property type="bool" key="resizable">false</property>
145+
<property type="double" key="height">110</property>
146+
<property type="double" key="width">290</property>
147+
<property type="double" key="z">1</property>
148+
149+
<property type="string" key="state">floating</property>
150+
<anchors target="3D View">
151+
<line own="right" target="right"/>
152+
<line own="bottom" target="bottom"/>
153+
</anchors>
154+
</ignition-gui>
155+
156+
<sim_time>true</sim_time>
157+
<real_time>true</real_time>
158+
<real_time_factor>true</real_time_factor>
159+
<iterations>true</iterations>
160+
<topic>/world/<%= $worldName %>/stats</topic>
161+
</plugin>
162+
</plugin>
163+
</executable_wrapper>
164+
<%end%>
165+
166+
<%= spawner(robotName, modelURI, $worldName, 0, 0, 0, 0, 0, 0) %>
167+
<%= rosExecutables(robotName, $worldName) %>
168+
169+
</ignition>
170+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw)
2+
<<-HEREDOC
3+
<spawn name='#{_name}'>
4+
<name>#{_name}</name>
5+
<allow_renaming>false</allow_renaming>
6+
<pose>#{_x} #{_y} #{_z + 0.205} #{_roll} #{_pitch} #{_yaw}</pose>
7+
<world>#{_worldName}</world>
8+
<is_performer>true</is_performer>
9+
<sdf version='1.6'>
10+
<include>
11+
<name>#{_name}</name>
12+
<uri>#{_modelURI}</uri>
13+
<!-- Diff drive -->
14+
<plugin filename=\"libignition-gazebo-diff-drive-system.so\"
15+
name=\"ignition::gazebo::systems::DiffDrive\">
16+
<left_joint>front_left_wheel_joint</left_joint>
17+
<left_joint>rear_left_wheel_joint</left_joint>
18+
<right_joint>front_right_wheel_joint</right_joint>
19+
<right_joint>rear_right_wheel_joint</right_joint>
20+
<wheel_separation>0.51</wheel_separation>
21+
<wheel_radius>0.205</wheel_radius>
22+
<topic>/model/#{_name}/cmd_vel_relay</topic>
23+
<min_velocity>-2.8</min_velocity>
24+
<max_velocity>2.8</max_velocity>
25+
<min_acceleration>-5.0</min_acceleration>
26+
<max_acceleration>5.0</max_acceleration>
27+
</plugin>
28+
<!-- Publish robot state information -->
29+
<plugin filename=\"libignition-gazebo-pose-publisher-system.so\"
30+
name=\"ignition::gazebo::systems::PosePublisher\">
31+
<publish_link_pose>true</publish_link_pose>
32+
<publish_sensor_pose>true</publish_sensor_pose>
33+
<publish_collision_pose>false</publish_collision_pose>
34+
<publish_visual_pose>false</publish_visual_pose>
35+
<publish_nested_model_pose>#{$enableGroundTruth}</publish_nested_model_pose>
36+
<use_pose_vector_msg>true</use_pose_vector_msg>
37+
<static_publisher>true</static_publisher>
38+
<static_update_frequency>1</static_update_frequency>
39+
</plugin>
40+
<!-- Battery plugin -->
41+
<plugin filename=\"libignition-gazebo-linearbatteryplugin-system.so\"
42+
name=\"ignition::gazebo::systems::LinearBatteryPlugin\">
43+
<battery_name>linear_battery</battery_name>
44+
<voltage>25.2</voltage>
45+
<open_circuit_voltage_constant_coef>25.2</open_circuit_voltage_constant_coef>
46+
<open_circuit_voltage_linear_coef>-7.2</open_circuit_voltage_linear_coef>
47+
<initial_charge>12.5</initial_charge>
48+
<capacity>12.5</capacity>
49+
<resistance>0.0052</resistance>
50+
<smooth_current_tau>5.0</smooth_current_tau>
51+
<power_load>1.2552</power_load>
52+
<start_on_motion>true</start_on_motion>
53+
</plugin>
54+
<!-- Gas Sensor plugin -->"
55+
<plugin filename="libGasEmitterDetectorPlugin.so"
56+
name="subt::GasDetector">
57+
<topic>/model/#{_name}/gas_detected</topic>
58+
<update_rate>10</update_rate>
59+
<type>gas</type>
60+
</plugin>
61+
<!-- Wheel slip -->
62+
<plugin filename="libignition-gazebo-wheel-slip-system.so"
63+
name="ignition::gazebo::systems::WheelSlip">
64+
<wheel link_name="front_left_wheel">
65+
<slip_compliance_lateral>0.172</slip_compliance_lateral>
66+
<slip_compliance_longitudinal>0</slip_compliance_longitudinal>
67+
<wheel_normal_force>123.6</wheel_normal_force>
68+
<wheel_radius>0.205</wheel_radius>
69+
</wheel>
70+
<wheel link_name="rear_left_wheel">
71+
<slip_compliance_lateral>0.172</slip_compliance_lateral>
72+
<slip_compliance_longitudinal>0</slip_compliance_longitudinal>
73+
<wheel_normal_force>123.6</wheel_normal_force>
74+
<wheel_radius>0.205</wheel_radius>
75+
</wheel>
76+
<wheel link_name="front_right_wheel">
77+
<slip_compliance_lateral>0.172</slip_compliance_lateral>
78+
<slip_compliance_longitudinal>0</slip_compliance_longitudinal>
79+
<wheel_normal_force>123.6</wheel_normal_force>
80+
<wheel_radius>0.205</wheel_radius>
81+
</wheel>
82+
<wheel link_name="rear_right_wheel">
83+
<slip_compliance_lateral>0.172</slip_compliance_lateral>
84+
<slip_compliance_longitudinal>0</slip_compliance_longitudinal>
85+
<wheel_normal_force>123.6</wheel_normal_force>
86+
<wheel_radius>0.205</wheel_radius>
87+
</wheel>
88+
</plugin>
89+
</include>
90+
</sdf>
91+
</spawn>
92+
HEREDOC
93+
end
94+
95+
def rosExecutables(_name, _worldName)
96+
<<-HEREDOC
97+
<executable name='robot_description'>
98+
<command>roslaunch --wait coro_allie_sensor_config_1 description.launch world_name:=#{_worldName} name:=#{_name}</command>
99+
</executable>
100+
<executable name='topics'>
101+
<command>roslaunch --wait coro_allie_sensor_config_1 vehicle_topics.launch world_name:=#{_worldName} name:=#{_name}</command>
102+
</executable>
103+
HEREDOC
104+
end

0 commit comments

Comments
 (0)