-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for wide angle camera in sensors system (#1215)
Signed-off-by: Ian Chen <ichen@osrfoundation.org> Signed-off-by: Steve Peters <scpeters@openrobotics.org> Signed-off-by: William Lew <WilliamMilesLew@gmail.com> Co-authored-by: Steve Peters <scpeters@openrobotics.org> Co-authored-by: William Lew <WilliamMilesLew@gmail.com> Co-authored-by: Louise Poubel <louise@openrobotics.org>
- Loading branch information
1 parent
fc9cadd
commit b9206e2
Showing
11 changed files
with
686 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -518,7 +518,6 @@ | |
</link> | ||
</model> | ||
|
||
|
||
<include> | ||
<pose>0 1 3 0.0 0.0 1.57</pose> | ||
<uri> | ||
|
This file contains 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,355 @@ | ||
<?xml version="1.0" ?> | ||
<!-- | ||
Load a world with wide angle camera | ||
--> | ||
<sdf version="1.6"> | ||
<world name="wide_angle_camera_sensor"> | ||
<physics name="1ms" type="ignored"> | ||
<max_step_size>0.001</max_step_size> | ||
<real_time_factor>1.0</real_time_factor> | ||
</physics> | ||
<plugin | ||
filename="ignition-gazebo-physics-system" | ||
name="ignition::gazebo::systems::Physics"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-sensors-system" | ||
name="ignition::gazebo::systems::Sensors"> | ||
<render_engine>ogre</render_engine> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-user-commands-system" | ||
name="ignition::gazebo::systems::UserCommands"> | ||
</plugin> | ||
<plugin | ||
filename="ignition-gazebo-scene-broadcaster-system" | ||
name="ignition::gazebo::systems::SceneBroadcaster"> | ||
</plugin> | ||
|
||
|
||
<gui fullscreen="0"> | ||
|
||
<!-- 3D scene --> | ||
<plugin filename="MinimalScene" 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.4 0.4 0.4</ambient_light> | ||
<background_color>0.8 0.8 0.8</background_color> | ||
<camera_pose>-6 0 6 0 0.5 0</camera_pose> | ||
</plugin> | ||
|
||
<!-- Plugins that add functionality to the scene --> | ||
<plugin filename="EntityContextMenuPlugin" name="Entity context menu"> | ||
<ignition-gui> | ||
<property key="state" type="string">floating</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
<plugin filename="GzSceneManager" name="Scene Manager"> | ||
<ignition-gui> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
<plugin filename="InteractiveViewControl" name="Interactive view control"> | ||
<ignition-gui> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
<plugin filename="CameraTracking" name="Camera Tracking"> | ||
<ignition-gui> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
<plugin filename="MarkerManager" name="Marker manager"> | ||
<ignition-gui> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
<plugin filename="SelectEntities" name="Select Entities"> | ||
<ignition-gui> | ||
<anchors target="Select entities"> | ||
<line own="right" target="right"/> | ||
<line own="top" target="top"/> | ||
</anchors> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
<plugin filename="VisualizationCapabilities" name="Visualization Capabilities"> | ||
<ignition-gui> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
<plugin filename="Spawn" name="Spawn Entities"> | ||
<ignition-gui> | ||
<anchors target="Select entities"> | ||
<line own="right" target="right"/> | ||
<line own="top" target="top"/> | ||
</anchors> | ||
<property key="resizable" type="bool">false</property> | ||
<property key="width" type="double">5</property> | ||
<property key="height" type="double">5</property> | ||
<property key="state" type="string">floating</property> | ||
<property key="showTitleBar" type="bool">false</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
<!-- World control --> | ||
<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> | ||
|
||
</plugin> | ||
|
||
<!-- World statistics --> | ||
<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> | ||
</plugin> | ||
|
||
<!-- Inspector --> | ||
<plugin filename="ComponentInspector" name="Component inspector"> | ||
<ignition-gui> | ||
<property type="string" key="state">docked</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
<!-- Entity tree --> | ||
<plugin filename="EntityTree" name="Entity tree"> | ||
<ignition-gui> | ||
<property type="string" key="state">docked</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
<plugin filename="ImageDisplay" name="Image Display"> | ||
<ignition-gui> | ||
<title>Wide angle camera</title> | ||
<property key="state" type="string">floating</property> | ||
<property type="double" key="width">350</property> | ||
<property type="double" key="height">315</property> | ||
</ignition-gui> | ||
<topic>wide_angle_camera</topic> | ||
<topic_picker>false</topic_picker> | ||
</plugin> | ||
|
||
</gui> | ||
|
||
<light type="directional" name="sun"> | ||
<cast_shadows>true</cast_shadows> | ||
<pose>0 0 10 0 0 0</pose> | ||
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
<specular>0.2 0.2 0.2 1</specular> | ||
<attenuation> | ||
<range>1000</range> | ||
<constant>0.9</constant> | ||
<linear>0.01</linear> | ||
<quadratic>0.001</quadratic> | ||
</attenuation> | ||
<direction>-0.5 0.1 -0.9</direction> | ||
</light> | ||
|
||
<model name="ground_plane"> | ||
<static>true</static> | ||
<link name="link"> | ||
<collision name="collision"> | ||
<geometry> | ||
<!--plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane--> | ||
<box> | ||
<size>20 20 0.1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<!--plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane--> | ||
<box> | ||
<size>20 20 0.1</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>0.8 0.8 0.8 1</ambient> | ||
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
<specular>0.8 0.8 0.8 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
</model> | ||
|
||
<model name="box"> | ||
<pose>0 -1 0.5 0 0 0</pose> | ||
<link name="box_link"> | ||
<inertial> | ||
<inertia> | ||
<ixx>1</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>1</iyy> | ||
<iyz>0</iyz> | ||
<izz>1</izz> | ||
</inertia> | ||
<mass>1.0</mass> | ||
</inertial> | ||
<collision name="box_collision"> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
|
||
<visual name="box_visual"> | ||
<geometry> | ||
<box> | ||
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>1 0 0 1</ambient> | ||
<diffuse>1 0 0 1</diffuse> | ||
<specular>1 0 0 1</specular> | ||
</material> | ||
</visual> | ||
</link> | ||
</model> | ||
|
||
<model name="wide_angle_camera"> | ||
<static>true</static> | ||
<pose>1 1 0.5 0 0.0 3.14</pose> | ||
<link name="link"> | ||
<collision name="collision"> | ||
<geometry> | ||
<box> | ||
<size>0.1 0.1 0.1</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<box> | ||
<size>0.1 0.1 0.1</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
<sensor name="wideangle_camera" type="wideanglecamera"> | ||
<camera> | ||
<horizontal_fov>3.14</horizontal_fov> | ||
<image> | ||
<width>800</width> | ||
<height>600</height> | ||
</image> | ||
<clip> | ||
<near>0.1</near> | ||
<far>100</far> | ||
</clip> | ||
<!-- A new section named `lens`. --> | ||
<lens> | ||
<!-- type element is mandatory --> | ||
<type>custom</type> | ||
<!-- manually defined mapping function r = c1*f*fun(theta/c2 + c3) --> | ||
<!-- More information here: https://en.wikipedia.org/wiki/Fisheye_lens#Mapping_function --> | ||
<custom_function> | ||
<c1>1.05</c1> | ||
<!-- linear scaling --> | ||
<c2>4</c2> | ||
<!-- angle scaling --> | ||
<f>1.0</f> | ||
<!-- one more scaling parameter --> | ||
<fun>tan</fun> | ||
<!-- one of sin,tan,id --> | ||
</custom_function> | ||
<!-- if it is set to `true` your horizontal FOV will ramain as defined --> | ||
<!-- othervise it depends on lens type and custom function, if there is one --> | ||
<scale_to_hfov>true</scale_to_hfov> | ||
<!-- clip everything that is outside of this angle --> | ||
<cutoff_angle>3.1415</cutoff_angle> | ||
<!-- resolution of the cubemap texture, the highter it is - the sharper is your image --> | ||
<env_texture_size>512</env_texture_size> | ||
</lens> | ||
</camera> | ||
<always_on>1</always_on> | ||
<update_rate>30</update_rate> | ||
<topic>wide_angle_camera</topic> | ||
</sensor> | ||
</link> | ||
</model> | ||
|
||
<include> | ||
<pose>0 1 3 0.0 0.0 1.57</pose> | ||
<uri> | ||
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Construction Cone | ||
</uri> | ||
</include> | ||
|
||
</world> | ||
</sdf> |
Oops, something went wrong.