-
Notifications
You must be signed in to change notification settings - Fork 108
Model Submission for JHUAPL Edge540XL sensor config 1 and uav simulation plugin #869
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
heyyeh12
wants to merge
3
commits into
osrf:master
Choose a base branch
from
JHU-APL-Accipiter:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
submitted_models/jhuapl_edge540xl_sensor_config_1/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| cmake_minimum_required(VERSION 2.8.3) | ||
| project(jhuapl_edge540xl_sensor_config_1) | ||
|
|
||
| find_package(catkin REQUIRED) | ||
|
|
||
| catkin_package() | ||
|
|
||
| install(DIRECTORY launch meshes urdf | ||
| DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
|
|
||
| install(FILES model.sdf model.config | ||
| DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) |
21 changes: 21 additions & 0 deletions
21
submitted_models/jhuapl_edge540xl_sensor_config_1/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # JHU/APL Edge540XL Sensor Config 1 | ||
| This package contains a virtual model validation for the JHU/APL Edge540XL with Sensor Configuration 1. Please see the [specifications.md](specifications.md) file for more information. | ||
|
|
||
| **Authors & Maintainers**: | ||
|
|
||
| * Joe Moore | ||
| * Adam Polevoy | ||
| * Bryanna Yeh | ||
|
|
||
| **Affiliation:** [The Johns Hopkins University Applied Physics Laboratory](https://www.jhuapl.edu/) | ||
|
|
||
| [](doc/edge540xl.png) | ||
|
|
||
| ## License | ||
| This software is released under a BSD license. | ||
|
|
||
| ## Example | ||
| ``` | ||
| cd <jhuapl_edge540xl_sensor_config_1>/launch | ||
| ign launch example.ign robotName:=edge540XL -v 4 | ||
| ``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
submitted_models/jhuapl_edge540xl_sensor_config_1/launch/description.launch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0"?> | ||
| <launch> | ||
| <arg name="name" default="Edge540XL" doc="Name of Vehicle"/> | ||
| <param name="$(arg name)/robot_description" command="$(find xacro)/xacro '$(find jhuapl_edge540xl_sensor_config_1)/urdf/Edge540XLPlant.urdf' name:=$(arg name)"/> | ||
| </launch> |
172 changes: 172 additions & 0 deletions
172
submitted_models/jhuapl_edge540xl_sensor_config_1/launch/example.ign
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| <?xml version="1.0"?> | ||
| <!-- Usage: ign launch path/to/example.ign robotName:=<X1> | ||
|
|
||
| Parameters: | ||
| robotName: Name to be assigned to model | ||
| --> | ||
| <% | ||
| require_relative 'spawner' | ||
|
|
||
| # Modify these as needed | ||
| $enableGroundTruth = true | ||
| $headless = local_variables.include?(:headless) ? :headless : false | ||
|
|
||
| %> | ||
|
|
||
| <% | ||
|
|
||
| unless local_variables.include?(:robotName) | ||
| raise "missing parameters. robotName is a required parameter" | ||
| end | ||
|
|
||
| # This assumes that this launch file is in a directory below the model | ||
| modelURI = File.expand_path("../", File.dirname(__FILE__)) | ||
| $worldName = 'example' | ||
| worldFile = File.join(File.expand_path("../worlds", File.dirname(__FILE__)), "#{$worldName}.sdf") | ||
| $plantName = 'Edge540XL' | ||
| plantURDF = File.join(File.expand_path("../urdf", File.dirname(__FILE__)), "#{$plantName}Plant.urdf") | ||
| %> | ||
|
|
||
| <ignition version='1.0'> | ||
| <env> | ||
| <name>IGN_GAZEBO_SYSTEM_PLUGIN_PATH</name> | ||
| <value>$LD_LIBRARY_PATH</value> | ||
| </env> | ||
|
|
||
| <!-- Start ROS first. This is a bit hacky for now. --> | ||
| <!-- Make sure to source /opt/ros/melodic/setup.bash --> | ||
| <executable name='ros'> | ||
| <command>roslaunch subt_ros competition_init.launch world_name:=<%=$worldName%> vehicle_topics:=0 enable_ground_truth:=<%=($enableGroundTruth)?"1":"0"%> robot_names:=<%=robotName%></command> | ||
| </executable> | ||
|
|
||
| <plugin name="ignition::launch::GazeboServer" | ||
| filename="libignition-launch-gazebo.so"> | ||
| <world_file><%= worldFile %></world_file> | ||
| <run>true</run> | ||
| <levels>false</levels> | ||
| <record> | ||
| <enabled>false</enabled> | ||
| </record> | ||
|
|
||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-physics-system.so" | ||
| name="ignition::gazebo::systems::Physics"> | ||
| </plugin> | ||
|
|
||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-sensors-system.so" | ||
| name="ignition::gazebo::systems::Sensors"> | ||
| <render_engine>ogre2</render_engine> | ||
| </plugin> | ||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-user-commands-system.so" | ||
| name="ignition::gazebo::systems::UserCommands"> | ||
| </plugin> | ||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-scene-broadcaster-system.so" | ||
| name="ignition::gazebo::systems::SceneBroadcaster"> | ||
| </plugin> | ||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-imu-system.so" | ||
| name="ignition::gazebo::systems::Imu"> | ||
| </plugin> | ||
|
|
||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-magnetometer-system.so" | ||
| name="ignition::gazebo::systems::Magnetometer"> | ||
| </plugin> | ||
|
|
||
| <plugin entity_name="<%= $worldName %>" | ||
| entity_type="world" | ||
| filename="libignition-gazebo-air-pressure-system.so" | ||
| name="ignition::gazebo::systems::AirPressure"> | ||
| </plugin> | ||
| </plugin> | ||
|
|
||
| <%if !$headless %> | ||
| <executable_wrapper> | ||
| <plugin name="ignition::launch::GazeboGui" | ||
| filename="libignition-launch-gazebogui.so"> | ||
| <world_name><%= $worldName %></world_name> | ||
| <window_title>SubT Simulator</window_title> | ||
| <window_icon><%= ENV['SUBT_IMAGES_PATH'] %>/SubT_logo.svg</window_icon> | ||
| <plugin filename="GzScene3D" name="3D View"> | ||
| <ignition-gui> | ||
| <title>3D View</title> | ||
| <property type="bool" key="showTitleBar">false</property> | ||
| <property type="string" key="state">docked</property> | ||
| </ignition-gui> | ||
|
|
||
| <engine>ogre2</engine> | ||
| <scene>scene</scene> | ||
| <ambient_light>0.2 0.2 0.1</ambient_light> | ||
| <background_color>0.8 0.8 0.8</background_color> | ||
| <camera_pose>-6.3 -4.2 3.6 0 0.268 0.304</camera_pose> | ||
| <service>/world/<%= $worldName %>/scene/info</service> | ||
| <pose_topic>/world/<%= $worldName %>/pose/info</pose_topic> | ||
| <scene_topic>/world/<%= $worldName %>/scene/info</scene_topic> | ||
| <deletion_topic>/world/<%= $worldName %>/scene/deletion</deletion_topic> | ||
| </plugin> | ||
| <plugin filename="WorldControl" name="World control"> | ||
| <ignition-gui> | ||
| <title>World control</title> | ||
| <property type="bool" key="showTitleBar">false</property> | ||
| <property type="bool" key="resizable">false</property> | ||
| <property type="double" key="height">72</property> | ||
| <property type="double" key="width">121</property> | ||
| <property type="double" key="z">1</property> | ||
|
|
||
| <property type="string" key="state">floating</property> | ||
| <anchors target="3D View"> | ||
| <line own="left" target="left"/> | ||
| <line own="bottom" target="bottom"/> | ||
| </anchors> | ||
| </ignition-gui> | ||
|
|
||
| <play_pause>true</play_pause> | ||
| <step>true</step> | ||
| <start_paused>true</start_paused> | ||
| <service>/world/<%= $worldName %>/control</service> | ||
| <stats_topic>/world/<%= $worldName %>/stats</stats_topic> | ||
|
|
||
| </plugin> | ||
|
|
||
| <plugin filename="WorldStats" name="World stats"> | ||
| <ignition-gui> | ||
| <title>World stats</title> | ||
| <property type="bool" key="showTitleBar">false</property> | ||
| <property type="bool" key="resizable">false</property> | ||
| <property type="double" key="height">110</property> | ||
| <property type="double" key="width">290</property> | ||
| <property type="double" key="z">1</property> | ||
|
|
||
| <property type="string" key="state">floating</property> | ||
| <anchors target="3D View"> | ||
| <line own="right" target="right"/> | ||
| <line own="bottom" target="bottom"/> | ||
| </anchors> | ||
| </ignition-gui> | ||
|
|
||
| <sim_time>true</sim_time> | ||
| <real_time>true</real_time> | ||
| <real_time_factor>true</real_time_factor> | ||
| <iterations>true</iterations> | ||
| <topic>/world/<%= $worldName %>/stats</topic> | ||
| </plugin> | ||
| </plugin> | ||
| </executable_wrapper> | ||
| <%end%> | ||
|
|
||
| <plugin name="ignition::launch::GazeboFactory" | ||
| filename="libignition-launch-gazebo-factory.so"> | ||
| <%= spawner(robotName, modelURI, $worldName, 0, 0, 0.2, 0, 0, 0, plantURDF) %> | ||
| </plugin> | ||
| <%= rosExecutables(robotName, $worldName) %> | ||
|
|
||
| </ignition> |
58 changes: 58 additions & 0 deletions
58
submitted_models/jhuapl_edge540xl_sensor_config_1/launch/spawner.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| def spawner(_name, _modelURI, _worldName, _x, _y, _z, _roll, _pitch, _yaw, _plantURDF='urdf/Edge540XLPlant.urdf') | ||
| <<-HEREDOC | ||
| <spawn name='#{_name}'> | ||
| <name>#{_name}</name> | ||
| <allow_renaming>false</allow_renaming> | ||
| <pose>#{_x} #{_y} #{_z + 0.2} #{_roll} #{_pitch} #{_yaw}</pose> | ||
| <world>#{_worldName}</world> | ||
| <is_performer>true</is_performer> | ||
| <sdf version='1.6'> | ||
| <include> | ||
| <name>#{_name}</name> | ||
| <uri>#{_modelURI}</uri> | ||
|
|
||
| <!-- Simulate plane dynamics --> | ||
| <plugin filename="libjhuapl_uav_dynamics.so" | ||
| name="jhuapl::Edge540xlDynamics"> | ||
| <plant_urdf_file>#{_plantURDF}</plant_urdf_file> | ||
| <model_name>#{_name}</model_name> | ||
| <link_name>fuselage</link_name> | ||
| <min_x>-1000</min_x> | ||
| <max_x>1000</max_x> | ||
| <min_y>-1000</min_y> | ||
| <max_y>1000</max_y> | ||
| <min_z>-1000</min_z> | ||
| <max_z>1000</max_z> | ||
| </plugin> | ||
|
|
||
| <!-- Battery plugin --> | ||
| <plugin filename="libignition-gazebo-linearbatteryplugin-system.so" | ||
| name="ignition::gazebo::systems::LinearBatteryPlugin"> | ||
| <battery_name>linear_battery</battery_name> | ||
| <voltage>12.4</voltage> | ||
| <open_circuit_voltage_constant_coef>12.4</open_circuit_voltage_constant_coef> | ||
| <open_circuit_voltage_linear_coef>-3.1424</open_circuit_voltage_linear_coef> | ||
| <initial_charge>12.3</initial_charge> | ||
| <capacity>12.3</capacity> | ||
| <resistance>0.061523</resistance> | ||
| <smooth_current_tau>1.9499</smooth_current_tau> | ||
| <power_load>5.214</power_load> | ||
| <start_on_motion>true</start_on_motion> | ||
| </plugin> | ||
|
|
||
| </include> | ||
| </sdf> | ||
| </spawn> | ||
| HEREDOC | ||
| end | ||
|
|
||
| def rosExecutables(_name, _worldName) | ||
| <<-HEREDOC | ||
| <executable name='robot_description'> | ||
| <command>roslaunch --wait jhuapl_edge540xl_sensor_config_1 description.launch world_name:=#{_worldName} name:=#{_name}</command> | ||
| </executable> | ||
| <executable name='topics'> | ||
| <command>roslaunch --wait jhuapl_edge540xl_sensor_config_1 vehicle_topics.launch world_name:=#{_worldName} name:=#{_name}</command> | ||
| </executable> | ||
| HEREDOC | ||
| end |
80 changes: 80 additions & 0 deletions
80
submitted_models/jhuapl_edge540xl_sensor_config_1/launch/vehicle_topics.launch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| <?xml version="1.0"?> | ||
| <launch> | ||
| <env name="IGN_TRANSPORT_TOPIC_STATISTICS" value="1"/> | ||
| <arg name="world_name" default="example"/> | ||
| <arg name="name" default="plane"/> | ||
| <arg name="link_name" value="fuselage"/> | ||
| <arg name="sensor_prefix" value="/world/$(arg world_name)/model/$(arg name)/link/$(arg link_name)/sensor"/> | ||
| <arg name="breadcrumbs" default="0"/> | ||
|
|
||
| <group ns="$(arg name)"> | ||
|
|
||
| <group ns="camera_front"> | ||
| <node | ||
| pkg="ros_ign_bridge" | ||
| type="parameter_bridge" | ||
| name="ros_ign_bridge_camera" | ||
| args="$(arg sensor_prefix)/camera_front/camera_info@sensor_msgs/CameraInfo[ignition.msgs.CameraInfo"> | ||
| <remap from="$(arg sensor_prefix)/camera_front/camera_info" to="camera_info"/> | ||
| </node> | ||
| <node | ||
| pkg="ros_ign_image" | ||
| type="image_bridge" | ||
| name="ros_ign_image_camera" | ||
| args="$(arg sensor_prefix)/camera_front/image"> | ||
| <remap from="$(arg sensor_prefix)/camera_front/image" to="image_raw"/> | ||
| </node> | ||
|
|
||
| <node | ||
| pkg="subt_ros" | ||
| type="optical_frame_publisher" | ||
| name="optical_frame_publisher"> | ||
| <remap from="input/image" to="image_raw" /> | ||
| <remap from="output/image" to="optical/image_raw" /> | ||
| <remap from="input/camera_info" to="camera_info" /> | ||
| <remap from="output/camera_info" to="optical/camera_info" /> | ||
| </node> | ||
|
|
||
| </group> | ||
|
|
||
| <!-- Control Commands --> | ||
| <node | ||
| pkg="ros_ign_bridge" | ||
| type="parameter_bridge" | ||
| name="ros_ign_bridge_uav_input" | ||
| args="/$(arg name)/input@mav_msgs/Actuators]ignition.msgs.Actuators"> | ||
| </node> | ||
|
|
||
| <!-- Robot's state --> | ||
|
|
||
| <node | ||
| pkg="ros_ign_bridge" | ||
| type="parameter_bridge" | ||
| name="ros_ign_bridge_pose" | ||
| args="/model/$(arg name)/pose@tf2_msgs/TFMessage[ignition.msgs.Pose_V"> | ||
| <remap from="/model/$(arg name)/pose" to="pose"/> | ||
| </node> | ||
|
|
||
| <node | ||
| pkg="ros_ign_bridge" | ||
| type="parameter_bridge" | ||
| name="ros_ign_bridge_pose_static" | ||
| args="/model/$(arg name)/pose_static@tf2_msgs/TFMessage[ignition.msgs.Pose_V"> | ||
| <remap from="/model/$(arg name)/pose_static" to="pose_static"/> | ||
| </node> | ||
|
|
||
| <node | ||
| pkg="ros_ign_bridge" | ||
| type="parameter_bridge" | ||
| name="ros_ign_bridge_battery_state" | ||
| args="/model/$(arg name)/battery/linear_battery/state@sensor_msgs/BatteryState[ignition.msgs.BatteryState"> | ||
| <remap from="/model/$(arg name)/battery/linear_battery/state" to="battery_state"/> | ||
| </node> | ||
|
|
||
| <node | ||
| pkg="subt_ros" | ||
| type="pose_tf_broadcaster" | ||
| name="pose_tf_broadcaster"/> | ||
| </group> | ||
|
|
||
| </launch> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an Ignition to ROS bridge node for your IMU sensor. Example