-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add support for nested models - Search for links, joints and sensors in nested models - Add a custom version of Model::JointByName implemented as a lambda - Search for entities given a scoped name and then check that those found support the required components (Joint and JointVelocity) - Rewrite the search for the IMU sensor component to use scoped names - In the `ApplyForce` function add a check that the JointVelocity and JointPosition components are valid before dereferencing them - Rename modeLink to imuLink (it is the pose of the link containing the IMU that is passed to the flight controller). - Fix initialisation of imuLink after rebase. - Replace references to ignition with gz replacements. Signed-off-by: Rhys Mainwaring <[email protected]> 2. Add support for nested models - Add utility to search for all descendent entities matching an un-scoped name. - Ensure initialisation of IMU sensor is backwards compatible. Signed-off-by: Rhys Mainwaring <[email protected]> 3. Add support for nested models - Move JointByName into Utils.hh Signed-off-by: Rhys Mainwaring <[email protected]> 4. Add support for nested models - Update Iris models. The basic model now has no plugins. Signed-off-by: Rhys Mainwaring <[email protected]> 5. Add support for nested models - Review feedback - remove commented code. Signed-off-by: Rhys Mainwaring <[email protected]>
- Loading branch information
1 parent
8686cc1
commit 28829af
Showing
9 changed files
with
374 additions
and
441 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,60 @@ | ||
/* | ||
Copyright (C) 2022 ardupilot.org | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <unordered_set> | ||
#include <vector> | ||
|
||
#include <gz/sim/Entity.hh> | ||
#include <gz/sim/EntityComponentManager.hh> | ||
#include <gz/sim/Export.hh> | ||
|
||
namespace gz | ||
{ | ||
namespace sim | ||
{ | ||
inline namespace GZ_SIM_VERSION_NAMESPACE { | ||
|
||
/// \brief Helper function to get an entity given its unscoped name. | ||
/// | ||
/// \param[in] _name Entity's unscoped name. | ||
/// \param[in] _ecm Immutable reference to ECM. | ||
/// \param[in] _relativeTo Entity that the unscoped name is relative to. | ||
/// If not provided, the unscoped name could be relative to any entity. | ||
/// \return All entities that match the unscoped name and relative to | ||
/// requirements, or an empty set otherwise. | ||
std::unordered_set<Entity> EntitiesFromUnscopedName( | ||
const std::string &_name, const EntityComponentManager &_ecm, | ||
Entity _relativeTo = kNullEntity); | ||
|
||
/// \brief Get the ID of a joint entity which is a descendent of this model. | ||
/// | ||
/// A replacement for gz::sim::Model::JointByName which does not resolve | ||
/// joints for nested models. | ||
/// \param[in] _ecm Entity-component manager. | ||
/// \param[in] _entity Model entity. | ||
/// \param[in] _name Scoped joint name. | ||
/// \return Joint entity. | ||
Entity JointByName(EntityComponentManager &_ecm, | ||
Entity _modelEntity, | ||
const std::string &_name); | ||
|
||
} | ||
} // namespace sim | ||
} // namespace gz |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0"?> | ||
|
||
<model> | ||
<name>Iris with Standoffs and Camera LiftDrag ArduCopter Plugins</name> | ||
<name>Iris with ArduCopter</name> | ||
<version>1.0</version> | ||
<sdf version="1.6">model.sdf</sdf> | ||
|
||
|
@@ -24,9 +24,8 @@ | |
|
||
<maintainer email="[email protected]">john hsu</maintainer> | ||
|
||
|
||
<description> | ||
starting with iris_with_standoffs | ||
Starting with iris_with_standoffs | ||
add LiftDragPlugin | ||
add ArduCopterPlugin | ||
attach gimbal_small_2d model with GimbalSmall2dPlugin | ||
|
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?xml version="1.0"?> | ||
|
||
<model> | ||
<name>Iris with Standoffs</name> | ||
<version>1.0</version> | ||
|
@@ -24,7 +23,6 @@ | |
|
||
<maintainer email="[email protected]">john hsu</maintainer> | ||
|
||
|
||
<description> | ||
A copy of the 3DR Iris model taken from | ||
https://github.com/PX4/sitl_gazebo/tree/master/models | ||
|
Oops, something went wrong.