From ef3a55f7f21dd5d00e9a1a361d0d2cf10ade06a0 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 3 May 2022 17:43:16 -0700 Subject: [PATCH 1/2] Migrate sources in src, test, examples, and include (#1008) (#1008) Signed-off-by: methylDragon --- include/sdf/Actor.hh | 4 ++-- include/sdf/AirPressure.hh | 2 +- include/sdf/Altimeter.hh | 2 +- include/sdf/Atmosphere.hh | 4 ++-- include/sdf/Box.hh | 6 +++--- include/sdf/Camera.hh | 4 ++-- include/sdf/Capsule.hh | 4 ++-- include/sdf/Collision.hh | 4 ++-- include/sdf/Cylinder.hh | 4 ++-- include/sdf/Ellipsoid.hh | 4 ++-- include/sdf/Error.hh | 2 +- include/sdf/Exception.hh | 2 +- include/sdf/Filesystem.hh | 2 +- include/sdf/ForceTorque.hh | 2 +- include/sdf/Frame.hh | 4 ++-- include/sdf/Geometry.hh | 2 +- include/sdf/Gui.hh | 2 +- include/sdf/Heightmap.hh | 4 ++-- include/sdf/Imu.hh | 2 +- include/sdf/InterfaceElements.hh | 4 ++-- include/sdf/InterfaceFrame.hh | 4 ++-- include/sdf/InterfaceJoint.hh | 4 ++-- include/sdf/InterfaceLink.hh | 4 ++-- include/sdf/InterfaceModel.hh | 4 ++-- include/sdf/InterfaceModelPoseGraph.hh | 4 ++-- include/sdf/Joint.hh | 4 ++-- include/sdf/JointAxis.hh | 4 ++-- include/sdf/Lidar.hh | 4 ++-- include/sdf/Light.hh | 6 +++--- include/sdf/Link.hh | 4 ++-- include/sdf/Magnetometer.hh | 2 +- include/sdf/Material.hh | 2 +- include/sdf/Mesh.hh | 4 ++-- include/sdf/Model.hh | 4 ++-- include/sdf/NavSat.hh | 4 ++-- include/sdf/Noise.hh | 2 +- include/sdf/OutputConfig.hh | 2 +- include/sdf/Param.hh | 2 +- include/sdf/ParserConfig.hh | 2 +- include/sdf/ParticleEmitter.hh | 4 ++-- include/sdf/Pbr.hh | 2 +- include/sdf/Physics.hh | 2 +- include/sdf/Plane.hh | 8 ++++---- include/sdf/PrintConfig.hh | 2 +- include/sdf/Root.hh | 2 +- include/sdf/Scene.hh | 4 ++-- include/sdf/SemanticPose.hh | 4 ++-- include/sdf/Sensor.hh | 4 ++-- include/sdf/Sky.hh | 4 ++-- include/sdf/Sphere.hh | 4 ++-- include/sdf/Surface.hh | 2 +- include/sdf/Visual.hh | 4 ++-- include/sdf/World.hh | 6 +++--- usd/include/sdf/usd/UsdError.hh | 2 +- usd/include/sdf/usd/usd_parser/USDData.hh | 2 +- usd/include/sdf/usd/usd_parser/USDStage.hh | 2 +- usd/include/sdf/usd/usd_parser/USDTransforms.hh | 8 ++++---- 57 files changed, 98 insertions(+), 98 deletions(-) diff --git a/include/sdf/Actor.hh b/include/sdf/Actor.hh index a199627ca..c75a4c71e 100644 --- a/include/sdf/Actor.hh +++ b/include/sdf/Actor.hh @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" diff --git a/include/sdf/AirPressure.hh b/include/sdf/AirPressure.hh index 649e0edfa..044e03968 100644 --- a/include/sdf/AirPressure.hh +++ b/include/sdf/AirPressure.hh @@ -17,7 +17,7 @@ #ifndef SDF_AIRPRESSURE_HH_ #define SDF_AIRPRESSURE_HH_ -#include +#include #include #include diff --git a/include/sdf/Altimeter.hh b/include/sdf/Altimeter.hh index 35bc72977..0e46ce53f 100644 --- a/include/sdf/Altimeter.hh +++ b/include/sdf/Altimeter.hh @@ -17,7 +17,7 @@ #ifndef SDF_ALTIMETER_HH_ #define SDF_ALTIMETER_HH_ -#include +#include #include #include diff --git a/include/sdf/Atmosphere.hh b/include/sdf/Atmosphere.hh index fa43d9fa9..38747e328 100644 --- a/include/sdf/Atmosphere.hh +++ b/include/sdf/Atmosphere.hh @@ -17,8 +17,8 @@ #ifndef SDF_ATMOSPHERE_HH_ #define SDF_ATMOSPHERE_HH_ -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Box.hh b/include/sdf/Box.hh index 4c614fd1a..fb2ad1ef5 100644 --- a/include/sdf/Box.hh +++ b/include/sdf/Box.hh @@ -17,9 +17,9 @@ #ifndef SDF_BOX_HH_ #define SDF_BOX_HH_ -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/include/sdf/Camera.hh b/include/sdf/Camera.hh index 44c5874e6..5287f8f7f 100644 --- a/include/sdf/Camera.hh +++ b/include/sdf/Camera.hh @@ -18,8 +18,8 @@ #define SDF_CAMERA_HH_ #include -#include -#include +#include +#include #include #include diff --git a/include/sdf/Capsule.hh b/include/sdf/Capsule.hh index 045f68580..c376d86a4 100644 --- a/include/sdf/Capsule.hh +++ b/include/sdf/Capsule.hh @@ -17,8 +17,8 @@ #ifndef SDF_CAPSULE_HH_ #define SDF_CAPSULE_HH_ -#include -#include +#include +#include #include #include #include diff --git a/include/sdf/Collision.hh b/include/sdf/Collision.hh index 318742ead..41b9ed8eb 100644 --- a/include/sdf/Collision.hh +++ b/include/sdf/Collision.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Cylinder.hh b/include/sdf/Cylinder.hh index f62189c4c..51d56b430 100644 --- a/include/sdf/Cylinder.hh +++ b/include/sdf/Cylinder.hh @@ -17,8 +17,8 @@ #ifndef SDF_CYLINDER_HH_ #define SDF_CYLINDER_HH_ -#include -#include +#include +#include #include #include #include diff --git a/include/sdf/Ellipsoid.hh b/include/sdf/Ellipsoid.hh index cf8dbdad9..f98822ab6 100644 --- a/include/sdf/Ellipsoid.hh +++ b/include/sdf/Ellipsoid.hh @@ -17,8 +17,8 @@ #ifndef SDF_ELLIPSOID_HH_ #define SDF_ELLIPSOID_HH_ -#include -#include +#include +#include #include #include #include diff --git a/include/sdf/Error.hh b/include/sdf/Error.hh index 88558e279..104f88051 100644 --- a/include/sdf/Error.hh +++ b/include/sdf/Error.hh @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include "sdf/system_util.hh" diff --git a/include/sdf/Exception.hh b/include/sdf/Exception.hh index 1ada5e8bb..b7c6c382a 100644 --- a/include/sdf/Exception.hh +++ b/include/sdf/Exception.hh @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "sdf/system_util.hh" diff --git a/include/sdf/Filesystem.hh b/include/sdf/Filesystem.hh index a1e454c64..7498eab6d 100644 --- a/include/sdf/Filesystem.hh +++ b/include/sdf/Filesystem.hh @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include "sdf/system_util.hh" diff --git a/include/sdf/ForceTorque.hh b/include/sdf/ForceTorque.hh index b47b9a342..8728b0d3a 100644 --- a/include/sdf/ForceTorque.hh +++ b/include/sdf/ForceTorque.hh @@ -18,7 +18,7 @@ #define SDF_FORCE_TORQUE_HH_ #include -#include +#include #include #include #include diff --git a/include/sdf/Frame.hh b/include/sdf/Frame.hh index 3c327dab9..27d48debe 100644 --- a/include/sdf/Frame.hh +++ b/include/sdf/Frame.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Geometry.hh b/include/sdf/Geometry.hh index a6e444575..86237fe35 100644 --- a/include/sdf/Geometry.hh +++ b/include/sdf/Geometry.hh @@ -17,7 +17,7 @@ #ifndef SDF_GEOMETRY_HH_ #define SDF_GEOMETRY_HH_ -#include +#include #include #include #include diff --git a/include/sdf/Gui.hh b/include/sdf/Gui.hh index bfc80a23f..ab7b0b4c7 100644 --- a/include/sdf/Gui.hh +++ b/include/sdf/Gui.hh @@ -17,7 +17,7 @@ #ifndef SDF_GUI_HH_ #define SDF_GUI_HH_ -#include +#include #include "sdf/Element.hh" #include "sdf/Plugin.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Heightmap.hh b/include/sdf/Heightmap.hh index 9af6064d8..01d1b566f 100644 --- a/include/sdf/Heightmap.hh +++ b/include/sdf/Heightmap.hh @@ -18,8 +18,8 @@ #define SDF_HEIGHTMAP_HH_ #include -#include -#include +#include +#include #include #include #include diff --git a/include/sdf/Imu.hh b/include/sdf/Imu.hh index 8801f4af2..2223b3827 100644 --- a/include/sdf/Imu.hh +++ b/include/sdf/Imu.hh @@ -18,7 +18,7 @@ #define SDF_IMU_HH_ #include -#include +#include #include #include #include diff --git a/include/sdf/InterfaceElements.hh b/include/sdf/InterfaceElements.hh index 1b8cc21ea..ed3e14a51 100644 --- a/include/sdf/InterfaceElements.hh +++ b/include/sdf/InterfaceElements.hh @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/InterfaceModel.hh" diff --git a/include/sdf/InterfaceFrame.hh b/include/sdf/InterfaceFrame.hh index 4bd9a1882..180642756 100644 --- a/include/sdf/InterfaceFrame.hh +++ b/include/sdf/InterfaceFrame.hh @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include "sdf/sdf_config.h" #include "sdf/system_util.hh" diff --git a/include/sdf/InterfaceJoint.hh b/include/sdf/InterfaceJoint.hh index 2840929fd..9df48f3c6 100644 --- a/include/sdf/InterfaceJoint.hh +++ b/include/sdf/InterfaceJoint.hh @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include "sdf/sdf_config.h" #include "sdf/system_util.hh" diff --git a/include/sdf/InterfaceLink.hh b/include/sdf/InterfaceLink.hh index 35ccaea7d..25ad28250 100644 --- a/include/sdf/InterfaceLink.hh +++ b/include/sdf/InterfaceLink.hh @@ -20,8 +20,8 @@ #include -#include -#include +#include +#include #include "sdf/sdf_config.h" #include "sdf/system_util.hh" diff --git a/include/sdf/InterfaceModel.hh b/include/sdf/InterfaceModel.hh index 30e1d6fbc..c63e3b160 100644 --- a/include/sdf/InterfaceModel.hh +++ b/include/sdf/InterfaceModel.hh @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include "sdf/InterfaceFrame.hh" #include "sdf/InterfaceJoint.hh" diff --git a/include/sdf/InterfaceModelPoseGraph.hh b/include/sdf/InterfaceModelPoseGraph.hh index 1c1e84fd5..de5d4301b 100644 --- a/include/sdf/InterfaceModelPoseGraph.hh +++ b/include/sdf/InterfaceModelPoseGraph.hh @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Types.hh" diff --git a/include/sdf/Joint.hh b/include/sdf/Joint.hh index f0567ad1d..f9f9c14e1 100644 --- a/include/sdf/Joint.hh +++ b/include/sdf/Joint.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" diff --git a/include/sdf/JointAxis.hh b/include/sdf/JointAxis.hh index 2e5e96cf7..68335b2e4 100644 --- a/include/sdf/JointAxis.hh +++ b/include/sdf/JointAxis.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/Exception.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Lidar.hh b/include/sdf/Lidar.hh index 41ce9ebfd..ef9817c71 100644 --- a/include/sdf/Lidar.hh +++ b/include/sdf/Lidar.hh @@ -17,8 +17,8 @@ #ifndef SDF_LIDAR_HH_ #define SDF_LIDAR_HH_ -#include -#include +#include +#include #include #include diff --git a/include/sdf/Light.hh b/include/sdf/Light.hh index 5e62b28c7..708b33c96 100644 --- a/include/sdf/Light.hh +++ b/include/sdf/Light.hh @@ -19,9 +19,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" diff --git a/include/sdf/Link.hh b/include/sdf/Link.hh index bc86b1bc0..cf85e017f 100644 --- a/include/sdf/Link.hh +++ b/include/sdf/Link.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Magnetometer.hh b/include/sdf/Magnetometer.hh index 3c469828d..5561b3298 100644 --- a/include/sdf/Magnetometer.hh +++ b/include/sdf/Magnetometer.hh @@ -17,7 +17,7 @@ #ifndef SDF_MAGNETOMETER_HH_ #define SDF_MAGNETOMETER_HH_ -#include +#include #include #include #include diff --git a/include/sdf/Material.hh b/include/sdf/Material.hh index b544574a0..a9aed0be2 100644 --- a/include/sdf/Material.hh +++ b/include/sdf/Material.hh @@ -18,7 +18,7 @@ #define SDF_MATERIAL_HH_ #include -#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/sdf_config.h" diff --git a/include/sdf/Mesh.hh b/include/sdf/Mesh.hh index 46a99884a..51540a52e 100644 --- a/include/sdf/Mesh.hh +++ b/include/sdf/Mesh.hh @@ -18,8 +18,8 @@ #define SDF_MESH_HH_ #include -#include -#include +#include +#include #include #include #include diff --git a/include/sdf/Model.hh b/include/sdf/Model.hh index b0a702dc9..a681491c0 100644 --- a/include/sdf/Model.hh +++ b/include/sdf/Model.hh @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/OutputConfig.hh" #include "sdf/ParserConfig.hh" diff --git a/include/sdf/NavSat.hh b/include/sdf/NavSat.hh index 66b9b4b39..74bbd415b 100644 --- a/include/sdf/NavSat.hh +++ b/include/sdf/NavSat.hh @@ -17,13 +17,13 @@ #ifndef SDF_NAVSAT_HH_ #define SDF_NAVSAT_HH_ -#include +#include #include #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Noise.hh b/include/sdf/Noise.hh index 0b8756992..099afbc70 100644 --- a/include/sdf/Noise.hh +++ b/include/sdf/Noise.hh @@ -17,7 +17,7 @@ #ifndef SDF_NOISE_HH_ #define SDF_NOISE_HH_ -#include +#include #include #include #include diff --git a/include/sdf/OutputConfig.hh b/include/sdf/OutputConfig.hh index d253025fb..c32dcf86f 100644 --- a/include/sdf/OutputConfig.hh +++ b/include/sdf/OutputConfig.hh @@ -18,7 +18,7 @@ #ifndef SDF_OUTPUT_CONFIG_HH_ #define SDF_OUTPUT_CONFIG_HH_ -#include +#include #include "sdf/InterfaceElements.hh" #include "sdf/sdf_config.h" diff --git a/include/sdf/Param.hh b/include/sdf/Param.hh index e9404022b..513c8d29d 100644 --- a/include/sdf/Param.hh +++ b/include/sdf/Param.hh @@ -33,7 +33,7 @@ #include #include -#include +#include #include "sdf/Console.hh" #include "sdf/PrintConfig.hh" diff --git a/include/sdf/ParserConfig.hh b/include/sdf/ParserConfig.hh index 100d91012..500b8c120 100644 --- a/include/sdf/ParserConfig.hh +++ b/include/sdf/ParserConfig.hh @@ -23,7 +23,7 @@ #include #include -#include +#include #include "sdf/Error.hh" #include "sdf/InterfaceElements.hh" diff --git a/include/sdf/ParticleEmitter.hh b/include/sdf/ParticleEmitter.hh index 37a8dfb9a..c29f90878 100644 --- a/include/sdf/ParticleEmitter.hh +++ b/include/sdf/ParticleEmitter.hh @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Material.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Pbr.hh b/include/sdf/Pbr.hh index acc906dc8..e0a602b75 100644 --- a/include/sdf/Pbr.hh +++ b/include/sdf/Pbr.hh @@ -18,7 +18,7 @@ #define SDF_PBR_HH_ #include -#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/sdf_config.h" diff --git a/include/sdf/Physics.hh b/include/sdf/Physics.hh index 931eaf182..e07e8eda9 100644 --- a/include/sdf/Physics.hh +++ b/include/sdf/Physics.hh @@ -18,7 +18,7 @@ #define SDF_PHYSICS_HH_ #include -#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Plane.hh b/include/sdf/Plane.hh index c920a3801..7d7de39b3 100644 --- a/include/sdf/Plane.hh +++ b/include/sdf/Plane.hh @@ -17,10 +17,10 @@ #ifndef SDF_PLANE_HH_ #define SDF_PLANE_HH_ -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/include/sdf/PrintConfig.hh b/include/sdf/PrintConfig.hh index c74bfa590..99051c7a5 100644 --- a/include/sdf/PrintConfig.hh +++ b/include/sdf/PrintConfig.hh @@ -18,7 +18,7 @@ #define SDF_PRINTCONFIG_HH_ #include -#include +#include #include "sdf/sdf_config.h" #include "sdf/system_util.hh" diff --git a/include/sdf/Root.hh b/include/sdf/Root.hh index 318fa7e1b..3759df741 100644 --- a/include/sdf/Root.hh +++ b/include/sdf/Root.hh @@ -18,7 +18,7 @@ #define SDF_ROOT_HH_ #include -#include +#include #include "sdf/OutputConfig.hh" #include "sdf/ParserConfig.hh" diff --git a/include/sdf/Scene.hh b/include/sdf/Scene.hh index 1862f1ed5..2c655773c 100644 --- a/include/sdf/Scene.hh +++ b/include/sdf/Scene.hh @@ -17,8 +17,8 @@ #ifndef SDF_SCENE_HH_ #define SDF_SCENE_HH_ -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/Sky.hh" diff --git a/include/sdf/SemanticPose.hh b/include/sdf/SemanticPose.hh index 6692d8c04..ceb840777 100644 --- a/include/sdf/SemanticPose.hh +++ b/include/sdf/SemanticPose.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/include/sdf/Sensor.hh b/include/sdf/Sensor.hh index 6ee21ea6e..70c7f0265 100644 --- a/include/sdf/Sensor.hh +++ b/include/sdf/Sensor.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/Plugin.hh" #include "sdf/SemanticPose.hh" diff --git a/include/sdf/Sky.hh b/include/sdf/Sky.hh index f9679f0e3..338f237f0 100644 --- a/include/sdf/Sky.hh +++ b/include/sdf/Sky.hh @@ -18,8 +18,8 @@ #ifndef SDF_SKY_HH_ #define SDF_SKY_HH_ -#include -#include +#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Sphere.hh b/include/sdf/Sphere.hh index f60ee6e9a..76810b758 100644 --- a/include/sdf/Sphere.hh +++ b/include/sdf/Sphere.hh @@ -17,8 +17,8 @@ #ifndef SDF_SPHERE_HH_ #define SDF_SPHERE_HH_ -#include -#include +#include +#include #include #include diff --git a/include/sdf/Surface.hh b/include/sdf/Surface.hh index 724b45e63..475298870 100644 --- a/include/sdf/Surface.hh +++ b/include/sdf/Surface.hh @@ -17,7 +17,7 @@ #ifndef SDF_SURFACE_HH_ #define SDF_SURFACE_HH_ -#include +#include #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/sdf_config.h" diff --git a/include/sdf/Visual.hh b/include/sdf/Visual.hh index 9875f5d7d..fa95e01ab 100644 --- a/include/sdf/Visual.hh +++ b/include/sdf/Visual.hh @@ -19,8 +19,8 @@ #include #include -#include -#include +#include +#include #include "sdf/Box.hh" #include "sdf/Cylinder.hh" #include "sdf/Element.hh" diff --git a/include/sdf/World.hh b/include/sdf/World.hh index 7a3e28f0d..70c4de27a 100644 --- a/include/sdf/World.hh +++ b/include/sdf/World.hh @@ -20,9 +20,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "sdf/Atmosphere.hh" #include "sdf/Element.hh" diff --git a/usd/include/sdf/usd/UsdError.hh b/usd/include/sdf/usd/UsdError.hh index 763c81040..af2046f36 100644 --- a/usd/include/sdf/usd/UsdError.hh +++ b/usd/include/sdf/usd/UsdError.hh @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/usd/include/sdf/usd/usd_parser/USDData.hh b/usd/include/sdf/usd/usd_parser/USDData.hh index 9936858cb..da27eb88b 100644 --- a/usd/include/sdf/usd/usd_parser/USDData.hh +++ b/usd/include/sdf/usd/usd_parser/USDData.hh @@ -24,7 +24,7 @@ #include #include -#include +#include #include "sdf/Material.hh" #include "sdf/Types.hh" diff --git a/usd/include/sdf/usd/usd_parser/USDStage.hh b/usd/include/sdf/usd/usd_parser/USDStage.hh index 2bc8f5d25..ae7ee0550 100644 --- a/usd/include/sdf/usd/usd_parser/USDStage.hh +++ b/usd/include/sdf/usd/usd_parser/USDStage.hh @@ -21,7 +21,7 @@ #include #include -#include +#include #include "sdf/Types.hh" #include "sdf/sdf_config.h" diff --git a/usd/include/sdf/usd/usd_parser/USDTransforms.hh b/usd/include/sdf/usd/usd_parser/USDTransforms.hh index 4b0d75da5..7035ab3ac 100644 --- a/usd/include/sdf/usd/usd_parser/USDTransforms.hh +++ b/usd/include/sdf/usd/usd_parser/USDTransforms.hh @@ -21,11 +21,11 @@ #include #include -#include -#include -#include +#include +#include +#include -#include +#include // TODO(ahcorde) this is to remove deprecated "warnings" in usd, these warnings // are reported using #pragma message so normal diagnostic flags cannot remove From 7baa3ee4b79ab4e7fc16d72a1dad91577effb205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Wed, 4 May 2022 10:39:59 +0200 Subject: [PATCH 2/2] Added Root Python interface (#967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Co-authored-by: Steve Peters --- python/CMakeLists.txt | 2 + python/src/sdf/_ignition_sdformat_pybind11.cc | 5 + python/src/sdf/pyRoot.cc | 98 +++++++ python/src/sdf/pyRoot.hh | 41 +++ python/test/pyRoot_TEST.py | 262 ++++++++++++++++++ 5 files changed, 408 insertions(+) create mode 100644 python/src/sdf/pyRoot.cc create mode 100644 python/src/sdf/pyRoot.hh create mode 100644 python/test/pyRoot_TEST.py diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index cf69d5531..1ed09711c 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -55,6 +55,7 @@ pybind11_add_module(sdformat SHARED src/sdf/pyNoise.cc src/sdf/pyParserConfig.cc src/sdf/pyPlane.cc + src/sdf/pyRoot.cc src/sdf/pySemanticPose.cc src/sdf/pySphere.cc src/sdf/pySurface.cc @@ -96,6 +97,7 @@ if (BUILD_TESTING) pyNoise_TEST pyParserConfig_TEST pyPlane_TEST + pyRoot_TEST pySemanticPose_TEST pySphere_TEST pySurface_TEST diff --git a/python/src/sdf/_ignition_sdformat_pybind11.cc b/python/src/sdf/_ignition_sdformat_pybind11.cc index 58207e642..f5dc86b69 100644 --- a/python/src/sdf/_ignition_sdformat_pybind11.cc +++ b/python/src/sdf/_ignition_sdformat_pybind11.cc @@ -33,6 +33,7 @@ #include "pyNoise.hh" #include "pyParserConfig.hh" #include "pyPlane.hh" +#include "pyRoot.hh" #include "pySemanticPose.hh" #include "pySphere.hh" #include "pySurface.hh" @@ -60,9 +61,13 @@ PYBIND11_MODULE(sdformat, m) { sdf::python::defineNoise(m); sdf::python::defineParserConfig(m); sdf::python::definePlane(m); + sdf::python::defineRoot(m); sdf::python::defineSemanticPose(m); sdf::python::defineSphere(m); sdf::python::defineSurface(m); sdf::python::defineVisual(m); sdf::python::defineWorld(m); + + m.attr("SDF_VERSION") = SDF_VERSION; + m.attr("SDF_PROTOCOL_VERSION") = SDF_PROTOCOL_VERSION; } diff --git a/python/src/sdf/pyRoot.cc b/python/src/sdf/pyRoot.cc new file mode 100644 index 000000000..4709814aa --- /dev/null +++ b/python/src/sdf/pyRoot.cc @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2022 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. + */ + +#include "pyRoot.hh" + +#include +#include + +#include "sdf/Model.hh" +#include "sdf/Root.hh" +#include "sdf/World.hh" + +using namespace pybind11::literals; + +namespace sdf +{ +// Inline bracket to help doxygen filtering. +inline namespace SDF_VERSION_NAMESPACE { +namespace python +{ +///////////////////////////////////////////////// +void defineRoot(pybind11::object module) +{ + pybind11::class_(module, "Root") + .def(pybind11::init<>()) + .def("load", + pybind11::overload_cast(&sdf::Root::Load), + "Parse the given SDF file, and generate objects based on types " + "specified in the SDF file.") + .def("load", + pybind11::overload_cast< + const std::string &, const ParserConfig &>(&sdf::Root::Load), + "Parse the given SDF file, and generate objects based on types " + "specified in the SDF file.") + .def("load_sdf_string", + pybind11::overload_cast( + &sdf::Root::LoadSdfString), + "Parse the given SDF string, and generate objects based on types " + "specified in the SDF file.") + .def("load_sdf_string", + pybind11::overload_cast< + const std::string &, const ParserConfig &>( + &sdf::Root::LoadSdfString), + "Parse the given SDF string, and generate objects based on types " + "specified in the SDF file.") + .def("version", &sdf::Root::Version, + "Get the SDF version specified in the parsed file or SDF " + "pointer.") + .def("set_version", &sdf::Root::SetVersion, + "Set the SDF version string.") + .def("world_count", &sdf::Root::WorldCount, + "Get the number of worlds.") + .def("world_by_index", + pybind11::overload_cast( + &sdf::Root::WorldByIndex), + pybind11::return_value_policy::reference_internal, + "Get a world based on an index.") + .def("world_name_exists", &sdf::Root::WorldNameExists, + "Get whether a world name exists.") + .def("model", &sdf::Root::Model, + pybind11::return_value_policy::reference_internal, + "Get a model object if it exists.") + .def("set_model", &sdf::Root::SetModel, + pybind11::return_value_policy::reference_internal, + "Set the model object. This will override any existing model, " + "actor, and light object.") + .def("add_world", &sdf::Root::AddWorld, + "Add a world to the root.") + .def("clear_worlds", &sdf::Root::ClearWorlds, + "Remove all worlds.") + .def("update_graphs", &sdf::Root::UpdateGraphs, + "Recreate the frame and pose graphs for the worlds and model " + "that are children of this Root object. You can call this function " + "to build new graphs when the DOM was created programmatically, or " + "if you want to regenerate the graphs after editing the DOM.") + .def("__copy__", [](const sdf::Root &self) { + return self.Clone(); + }) + .def("__deepcopy__", [](const sdf::Root &self, pybind11::dict) { + return self.Clone(); + }, "memo"_a); +} +} // namespace python +} // namespace SDF_VERSION_NAMESPACE +} // namespace sdf diff --git a/python/src/sdf/pyRoot.hh b/python/src/sdf/pyRoot.hh new file mode 100644 index 000000000..9ad680aae --- /dev/null +++ b/python/src/sdf/pyRoot.hh @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 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 SDFORMAT_PYTHON_ROOT_HH_ +#define SDFORMAT_PYTHON_ROOT_HH_ + +#include + +#include "sdf/Root.hh" + +#include "sdf/config.hh" + +namespace sdf +{ +// Inline bracket to help doxygen filtering. +inline namespace SDF_VERSION_NAMESPACE { +namespace python +{ +/// Define a pybind11 wrapper for an sdf::Root +/** + * \param[in] module a pybind11 module to add the definition to + */ +void defineRoot(pybind11::object module); +} // namespace python +} // namespace SDF_VERSION_NAMESPACE +} // namespace sdf + +#endif // SDFORMAT_PYTHON_ROOT_HH_ diff --git a/python/test/pyRoot_TEST.py b/python/test/pyRoot_TEST.py new file mode 100644 index 000000000..6de4cdf60 --- /dev/null +++ b/python/test/pyRoot_TEST.py @@ -0,0 +1,262 @@ +# Copyright (C) 2022 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. + +import copy +from ignition.math import Vector3d, Pose3d +from sdformat import Error, Root, SDF_VERSION, SDF_PROTOCOL_VERSION, World +import unittest + + +class RootTEST(unittest.TestCase): + + def test_default_construction(self): + root = Root() + self.assertEqual(SDF_VERSION, root.version()) + self.assertFalse(root.world_name_exists("default")) + self.assertFalse(root.world_name_exists("")) + self.assertEqual(0, root.world_count()) + self.assertTrue(root.world_by_index(0) == None) + self.assertTrue(root.world_by_index(1) == None) + + self.assertEqual(None, root.model()) + # self.assertEqual(None, root.Light()) + # self.assertEqual(None, root.Actor()) + + + def test_string_model_sdf_parse(self): + sdf = """ + + + + + + + 3 4 5 + + + + + + """ + + root = Root() + errors = root.load_sdf_string(sdf) + self.assertEqual(0, len(errors)) + + model = root.model() + self.assertNotEqual(None, model) + + self.assertEqual("shapes", model.name()) + self.assertEqual(1, model.link_count()) + + link = model.link_by_index(0) + self.assertNotEqual(None, link) + self.assertEqual("link", link.name()) + self.assertEqual(1, link.collision_count()) + + collision = link.collision_by_index(0) + self.assertNotEqual(None, collision) + self.assertEqual("box_col", collision.name()) + + # self.assertEqual(None, root.Light()) + # self.assertEqual(None, root.Actor()) + self.assertEqual(0, root.world_count()) + + # Test cloning + root2 = copy.deepcopy(root) + + model2 = root2.model() + self.assertNotEqual(None, model2) + + self.assertEqual("shapes", model2.name()) + self.assertEqual(1, model2.link_count()) + + link2 = model2.link_by_index(0) + self.assertNotEqual(None, link2) + self.assertEqual("link", link2.name()) + self.assertEqual(1, link2.collision_count()) + + collision2 = link2.collision_by_index(0) + self.assertNotEqual(None, collision2) + self.assertEqual("box_col", collision2.name()) + + # self.assertEqual(None, root2.Light()) + # self.assertEqual(None, root2.Actor()) + self.assertEqual(0, root2.world_count()) + + +# ///////////////////////////////////////////////// +# TEST(DOMRoot, StringLightSdfParse) +# { +# std::string sdf = "" +# " " +# " " +# " -0.5 0.1 -0.9" +# " " +# " " +# +# root = Root() +# errors = root.load_sdf_string(sdf) +# self.assertTrue(errors.empty()) +# self.assertNotEqual(None, root.Element()) +# +# const sdf::Light *light = root.Light() +# self.assertNotEqual(None, light) +# self.assertEqual("sun", light.name()) +# self.assertNotEqual(None, light.Element()) +# +# self.assertEqual(None, root.model()) +# self.assertEqual(None, root.Actor()) +# self.assertEqual(0, root.world_count()) +# } +# +# ///////////////////////////////////////////////// +# TEST(DOMRoot, StringActorSdfParse) +# { +# std::string sdf = "" +# " " +# " " +# " 0 0 1.0 0 0 0" +# " " +# " /fake/path/to/mesh.dae" +# " 1.0" +# " " +# " " +# " /fake/path/to/mesh.dae" +# " 0.055" +# " true" +# " " +# " " +# " " +# " " +# +# root = Root() +# errors = root.load_sdf_string(sdf) +# self.assertTrue(errors.empty()) +# +# const sdf::Actor *actor = root.Actor() +# self.assertNotEqual(None, actor) +# self.assertEqual("actor_test", actor.name()) +# self.assertNotEqual(None, actor.Element()) +# +# self.assertEqual(None, root.model()) +# self.assertEqual(None, root.Light()) +# self.assertEqual(0, root.world_count()) +# } + + def test_set(self): + root = Root() + self.assertEqual(SDF_VERSION, root.version()) + root.set_version(SDF_PROTOCOL_VERSION) + self.assertEqual(SDF_PROTOCOL_VERSION, root.version()) + + + def test_frame_semantics_on_move(self): + sdfString1 = """ + + + + 0 1 0 0 0 0 + + + """ + + sdfString2 = """ + + + + 1 1 0 0 0 0 + + + """ + + def testFrame1(_root): + world = _root.world_by_index(0) + self.assertNotEqual(None, world) + frame = world.frame_by_index(0) + self.assertNotEqual(None, frame) + self.assertEqual("frame1", frame.name()) + pose = Pose3d() + errors = frame.semantic_pose().resolve(pose) + self.assertEqual(0, len(errors)) + self.assertEqual(Pose3d(0, 1, 0, 0, 0, 0), pose) + + def testFrame2(_root): + world = _root.world_by_index(0) + self.assertNotEqual(None, world) + frame = world.frame_by_index(0) + self.assertNotEqual(None, frame) + self.assertEqual("frame2", frame.name()) + pose = Pose3d() + errors = frame.semantic_pose().resolve(pose) + self.assertEqual(0, len(errors)) + self.assertEqual(Pose3d(1, 1, 0, 0, 0, 0), pose) + + root1 = Root() + errors = root1.load_sdf_string(sdfString1) + self.assertEqual(0, len(errors)) + testFrame1(root1) + + root2 = Root() + errors = root2.load_sdf_string(sdfString2) + self.assertEqual(0, len(errors)) + testFrame2(root2) + + + def test_add_world(self): + root = Root() + self.assertEqual(0, root.world_count()) + + world = World() + world.set_name("world1") + errors = root.add_world(world) + self.assertEqual(0, len(errors)) + self.assertEqual(1, root.world_count()) + self.assertEqual(1, len(root.add_world(world))) + self.assertEqual(Error.ErrorCode.DUPLICATE_NAME, root.add_world(world)[0].code()) + self.assertEqual(1, root.world_count()) + + root.clear_worlds() + self.assertEqual(0, root.world_count()) + + self.assertEqual(0, len(root.add_world(world))) + self.assertEqual(1, root.world_count()) + worldFromRoot = root.world_by_index(0) + self.assertNotEqual(None, worldFromRoot) + self.assertEqual(worldFromRoot.name(), world.name()) + + + def test_mutable_by_index(self): + root = Root() + self.assertEqual(0, root.world_count()) + + world = World() + world.set_name("world1") + self.assertEqual(0, len(root.add_world(world))) + self.assertEqual(1, root.world_count()) + + # Modify the world + w = root.world_by_index(0) + self.assertNotEqual(None, w) + self.assertEqual("world1", w.name()) + w.set_name("world2") + self.assertEqual("world2", root.world_by_index(0).name()) + + +if __name__ == '__main__': + unittest.main()