Fix the issue that the methods to find links, joints and sensors were not searching in nested models. This will permit more complex models containing sensors and other peripherals to be composed from a collection of simpler models.
ArduPilot plugin
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
Models
Update the iris and zephyr models to use scoped names for the imu sensor (i.e. the name imu_sensor becomes imu_link::imu_sensor)
Testing
Tested on a VMware Fusion 12 Ubuntu 20.04 VM with the most recent version of ignition edifice:
$ ign gazebo --version
Ignition Gazebo, version 5.3.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.
Bug Fix
Fixes #6
Details
Fix the issue that the methods to find links, joints and sensors were not searching in nested models. This will permit more complex models containing sensors and other peripherals to be composed from a collection of simpler models.
ArduPilot plugin
Model::JointByName
implemented as a lambdaJoint
andJointVelocity
)ApplyForce
function add a check that theJointVelocity
andJointPosition
components are valid before dereferencing themModels
imu_sensor
becomesimu_link::imu_sensor
)Testing
Tested on a VMware Fusion 12 Ubuntu 20.04 VM with the most recent version of ignition edifice:
An example of a model composed from a nested model is available here: https://github.com/srmainwaring/SITL_Models/tree/ignition/wildthumper-nested