-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Louise Poubel <[email protected]>
- Loading branch information
Showing
26 changed files
with
1,906 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?xml version="1.0" ?> | ||
<!-- | ||
Latitude / longitude demo | ||
The world origin's spherical coordinates can be inspected using the Component | ||
Inspector GUI plugin. | ||
Try changing the world origin coordinates with: | ||
ign service \ | ||
-s /world/spherical_coordinates/set_spherical_coordinates \ | ||
--reqtype ignition.msgs.SphericalCoordinates \ | ||
--reptype ignition.msgs.Boolean \ | ||
--timeout 2000 \ | ||
--req "surface_model: EARTH_WGS84, latitude_deg: 35.6, longitude_deg: 140.1, elevation: 10.0" | ||
Spawn a model in spherical coordinates: | ||
ign service -s /world/spherical_coordinates/create \ | ||
--reqtype ignition.msgs.EntityFactory \ | ||
--reptype ignition.msgs.Boolean \ | ||
--timeout 300 \ | ||
--req 'sdf: '\ | ||
'"<?xml version=\"1.0\" ?>'\ | ||
'<sdf version=\"1.6\">'\ | ||
'<model name=\"spawned_model\">'\ | ||
'<link name=\"link\">'\ | ||
'<visual name=\"visual\">'\ | ||
'<geometry><sphere><radius>1.0</radius></sphere></geometry>'\ | ||
'</visual>'\ | ||
'<collision name=\"visual\">'\ | ||
'<geometry><sphere><radius>1.0</radius></sphere></geometry>'\ | ||
'</collision>'\ | ||
'</link>'\ | ||
'</model>'\ | ||
'</sdf>" '\ | ||
'spherical_coordinates: {latitude_deg: 35.59999, longitude_deg: 140.09999, elevation: 11.0} ' | ||
Move a model in spherical coordinates: | ||
ign service -s /world/spherical_coordinates/set_spherical_coordinates \ | ||
--reqtype ignition.msgs.SphericalCoordinates \ | ||
--reptype ignition.msgs.Boolean \ | ||
--timeout 300 \ | ||
--req 'entity: {name: "spawned_model", type: MODEL}, latitude_deg: 35.59990, longitude_deg: 140.09990' | ||
--> | ||
<sdf version="1.6"> | ||
<world name="spherical coordinates"> | ||
|
||
<!-- Handles requests to update the spherical coordinates --> | ||
<plugin | ||
filename="ignition-gazebo-user-commands-system" | ||
name="ignition::gazebo::systems::UserCommands"> | ||
</plugin> | ||
|
||
<!-- Populates the GUI with data from the server --> | ||
<plugin | ||
filename="ignition-gazebo-scene-broadcaster-system" | ||
name="ignition::gazebo::systems::SceneBroadcaster"> | ||
</plugin> | ||
|
||
<!-- Processes pose commands --> | ||
<plugin | ||
filename="ignition-gazebo-physics-system" | ||
name="ignition::gazebo::systems::Physics"> | ||
</plugin> | ||
|
||
<!-- Set the coordinates for the world origin --> | ||
<spherical_coordinates> | ||
<surface_model>EARTH_WGS84</surface_model> | ||
<world_frame_orientation>ENU</world_frame_orientation> | ||
<latitude_deg>-22.9</latitude_deg> | ||
<longitude_deg>-43.2</longitude_deg> | ||
<elevation>0</elevation> | ||
<heading_deg>0</heading_deg> | ||
</spherical_coordinates> | ||
|
||
<gui fullscreen="0"> | ||
|
||
<!-- 3D scene --> | ||
<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.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> | ||
|
||
<!-- Component inspector --> | ||
<plugin filename="ComponentInspector" name="Component Inspector"> | ||
<ignition-gui> | ||
<property type="string" key="state">docked</property> | ||
</ignition-gui> | ||
</plugin> | ||
|
||
</gui> | ||
|
||
</world> | ||
</sdf> |
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
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
53 changes: 53 additions & 0 deletions
53
include/ignition/gazebo/components/SphericalCoordinates.hh
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,53 @@ | ||
/* | ||
* Copyright (C) 2021 Open Source Robotics Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
#ifndef IGNITION_GAZEBO_COMPONENTS_SPHERICALCOORDINATES_HH_ | ||
#define IGNITION_GAZEBO_COMPONENTS_SPHERICALCOORDINATES_HH_ | ||
|
||
#include <ignition/math/SphericalCoordinates.hh> | ||
#include <ignition/gazebo/components/Factory.hh> | ||
#include <ignition/gazebo/components/Component.hh> | ||
#include <ignition/gazebo/components/Serialization.hh> | ||
#include <ignition/gazebo/Conversions.hh> | ||
#include <ignition/gazebo/config.hh> | ||
|
||
namespace ignition | ||
{ | ||
namespace gazebo | ||
{ | ||
// Inline bracket to help doxygen filtering. | ||
inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE { | ||
namespace serializers | ||
{ | ||
using SphericalCoordinatesSerializer = | ||
serializers::ComponentToMsgSerializer<math::SphericalCoordinates, | ||
msgs::SphericalCoordinates>; | ||
} | ||
|
||
namespace components | ||
{ | ||
/// \brief This component holds the spherical coordinates of the world origin. | ||
using SphericalCoordinates = | ||
Component<math::SphericalCoordinates, class SphericalCoordinatesTag, | ||
serializers::SphericalCoordinatesSerializer>; | ||
IGN_GAZEBO_REGISTER_COMPONENT( | ||
"ign_gazebo_components.SphericalCoordinates", SphericalCoordinates) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif |
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
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
Oops, something went wrong.