-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jennuine/ostream_precision
Signed-off-by: Jenn Nguyen <[email protected]>
- Loading branch information
Showing
19 changed files
with
926 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* 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 "pyBox.hh" | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
#include "sdf/Box.hh" | ||
|
||
using namespace pybind11::literals; | ||
|
||
namespace sdf | ||
{ | ||
// Inline bracket to help doxygen filtering. | ||
inline namespace SDF_VERSION_NAMESPACE { | ||
namespace python | ||
{ | ||
///////////////////////////////////////////////// | ||
void defineBox(pybind11::object module) | ||
{ | ||
pybind11::class_<sdf::Box>(module, "Box") | ||
.def(pybind11::init<>()) | ||
.def(pybind11::init<sdf::Box>()) | ||
.def("size", &sdf::Box::Size, | ||
"Get the box size in meters.") | ||
.def("set_size", &sdf::Box::SetSize, | ||
"Set the box size in meters.") | ||
.def( | ||
"shape", | ||
pybind11::overload_cast<>(&sdf::Box::Shape, pybind11::const_), | ||
pybind11::return_value_policy::reference, | ||
"Get a mutable Ignition Math representation of this Box.") | ||
.def("__copy__", [](const sdf::Box &self) { | ||
return sdf::Box(self); | ||
}) | ||
.def("__deepcopy__", [](const sdf::Box &self, pybind11::dict) { | ||
return sdf::Box(self); | ||
}, "memo"_a); | ||
} | ||
} // namespace python | ||
} // namespace SDF_VERSION_NAMESPACE | ||
} // namespace 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_BOX_HH_ | ||
#define SDFORMAT_PYTHON_BOX_HH_ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
#include "sdf/Box.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::Box | ||
/** | ||
* \param[in] module a pybind11 module to add the definition to | ||
*/ | ||
void defineBox(pybind11::object module); | ||
} // namespace python | ||
} // namespace SDF_VERSION_NAMESPACE | ||
} // namespace sdf | ||
|
||
#endif // SDFORMAT_PYTHON_BOX_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
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,73 @@ | ||
/* | ||
* 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 "pyMesh.hh" | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
#include "sdf/ParserConfig.hh" | ||
#include "sdf/Mesh.hh" | ||
|
||
using namespace pybind11::literals; | ||
|
||
namespace sdf | ||
{ | ||
// Inline bracket to help doxygen filtering. | ||
inline namespace SDF_VERSION_NAMESPACE { | ||
namespace python | ||
{ | ||
///////////////////////////////////////////////// | ||
void defineMesh(pybind11::object module) | ||
{ | ||
pybind11::class_<sdf::Mesh>(module, "Mesh") | ||
.def(pybind11::init<>()) | ||
.def(pybind11::init<sdf::Mesh>()) | ||
.def("uri", &sdf::Mesh::Uri, | ||
"Get the mesh's URI.") | ||
.def("set_uri", &sdf::Mesh::SetUri, | ||
"Set the mesh's URI.") | ||
.def("file_path", &sdf::Mesh::FilePath, | ||
"The path to the file where this element was loaded from.") | ||
.def("set_file_path", &sdf::Mesh::SetFilePath, | ||
"Set the path to the file where this element was loaded from.") | ||
.def("scale", &sdf::Mesh::Scale, | ||
"Get the mesh's scale factor.") | ||
.def("set_scale", &sdf::Mesh::SetScale, | ||
"Set the mesh's scale factor.") | ||
.def("submesh", &sdf::Mesh::Submesh, | ||
"A submesh, contained with the mesh at the specified URI, may " | ||
"optionally be specified. If specified, this submesh should be used " | ||
"instead of the entire mesh.") | ||
.def("set_submesh", &sdf::Mesh::SetSubmesh, | ||
"Set the mesh's submesh. See Submesh() for more information.") | ||
.def("center_submesh", &sdf::Mesh::CenterSubmesh, | ||
"Get whether the submesh should be centered at 0,0,0. This will " | ||
"effectively remove any transformations on the submesh before the " | ||
"poses from parent links and models are applied. The return value is " | ||
"only applicable if a SubMesh has been specified.") | ||
.def("set_center_submesh", &sdf::Mesh::SetCenterSubmesh, | ||
"Set whether the submesh should be centered. See CenterSubmesh() " | ||
"for more information.") | ||
.def("__copy__", [](const sdf::Mesh &self) { | ||
return sdf::Mesh(self); | ||
}) | ||
.def("__deepcopy__", [](const sdf::Mesh &self, pybind11::dict) { | ||
return sdf::Mesh(self); | ||
}, "memo"_a); | ||
} | ||
} // namespace python | ||
} // namespace SDF_VERSION_NAMESPACE | ||
} // namespace 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_MESH_HH_ | ||
#define SDFORMAT_PYTHON_MESH_HH_ | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
#include "sdf/Mesh.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::Mesh | ||
/** | ||
* \param[in] module a pybind11 module to add the definition to | ||
*/ | ||
void defineMesh(pybind11::object module); | ||
} // namespace python | ||
} // namespace SDF_VERSION_NAMESPACE | ||
} // namespace sdf | ||
|
||
#endif // SDFORMAT_PYTHON_MESH_HH_ |
Oops, something went wrong.