Skip to content

Commit

Permalink
Merge branch 'master' into contact_detector
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi authored Mar 14, 2023
2 parents 7068302 + 3c9470a commit f3241a5
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 111 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to this project are documented in this file.

### Changed
- Update the `IK tutorial` to use `QPInverseKinematics::build` (https://github.com/ami-iit/bipedal-locomotion-framework/pull/621)
- Handle case where no FT sensors are specified to split the model (https://github.com/ami-iit/bipedal-locomotion-framework/pull/625)
- General restructure of the `ContactDetector`and the derived classes (`SchmittTriggerDetector` and `FixedFootDetector`) (https://github.com/ami-iit/bipedal-locomotion-framework/pull/624)
Thanks to this refactory the `FixedFootDetector` usage becomes similar to the others `advanceable`.
Indeed now `FixedFootDetector::advace()` considers the input set by the user and provides the corresponding output.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,47 +73,102 @@ class SubModel
std::vector<std::string> m_externalContactList; /**< List of the additional external contacts */

public:
/**
* Determines the validity of the object.
* @return True if the object is valid, false otherwise.
*/
bool isValid() const;

/**
* Getters
*/

/**
* @brief Access model.
* @brief Get the `iDynTree::Model` instance.
* @note The actual implementation of the Model is currently stored in an `iDynTree::Model`
* @return The model of the SubModel.
*/
const iDynTree::Model& getModel() const;

/**
* @brief Access jointListMapping.
* @brief Access the `std::vectot<int>` list.
* @return the mapping between the joint indeces in the sub-model and the joint indeces in the
* full-model.
*/
const std::vector<int>& getJointMapping() const;

/**
* @brief Access ftList.
* @brief Access the `std::vector<FT>` list.
* @return the list of FT objects which is the list of force/torque sensors.
*/
const std::vector<FT>& getFTList() const;

/**
* @brief Access accelerometerList.
* @brief Access the `std::vector<Sensor>` list of acceletometer sensors.
* @return a list of Sensor objects describing the accelerometers contained in the sub-model.
*/
const std::vector<Sensor>& getAccelerometerList() const;

/**
* @brief Access gyroscopeList.
* @brief Access the `std::vector<Sensor>` list of gyroscope sensors.
* @return a list of Sensor objects describing the gyroscope contained in the sub-model.
*/
const std::vector<Sensor>& getGyroscopeList() const;

/**
* @brief Access externalContactList.
* @brief Access the `std::vector<std::string>` list of frame names.
* @return a list of strings describing frame names of the external contacts for the sub-model.
*/
const std::vector<std::string>& getExternalContactList() const;

/**
* @brief access the length of force/torque sensor list.
* @return the number of force/torque sensors in the sub-model.
*/
std::size_t getNrOfFTSensor() const;

/**
* @brief access the length of accelerometer list.
* @return the number of accelerometer sensors in the sub-model.
*/
std::size_t getNrOfAccelerometer() const;

/**
* @brief access the length of gyroscope list.
* @return the number of gyroscope sensors in the sub-model.
*/
std::size_t getNrOfGyroscope() const;

/**
* @brief access the length of the contact frame list.
* @return the number of gyroscope sensors in the sub-model.
*/
std::size_t getNrOfExternalContact() const;

/**
* @brief Access an element of the force/torque sensor list.
* @return FT object associated with the specified index.
*/
const FT& getFTSensor(const int index) const;

/**
* @brief Access an element of the accelerometer list.
* @return a Sensor object corresponding to the accelerometer associated with the specified index.
*/
const Sensor& getAccelerometer(const int index) const;

/**
* @brief Access an element of the gyroscope list.
* @return a Sensor object corresponding to the gyroscope associated with the specified index.
*/
const Sensor& getGyroscope(const int index) const;

/**
* @brief access an element of the contact frame list.
* @return a string corresponding to the external contact frame associated with the specified index.
*/
const std::string& getExternalContact(const int index) const;

friend class SubModelCreator;
};

Expand Down Expand Up @@ -229,24 +284,18 @@ class SubModelCreator
*/
bool
createSubModels(std::weak_ptr<const BipedalLocomotion::ParametersHandler::IParametersHandler>
parameterHandler);
parameterHandler);

/**
* Setter
*/

/**
* @brief Set model
* @param model is an iDynTree Model object
*/
void setModel(const iDynTree::Model& model);

/**
* @brief Set sensorList
* @param sensorList is an iDynTree SensorsList object containing the list of Sensors
* (gyroscopes, accelerometers, force/torque sensors) in the model
* @brief Set model which is an instance of `iDynTree::ModelLoader` and the sensor list which is an instance of `iDynTree::SensorList`
* @param modelLoader is an iDynTree ModelLoader object
* @param sensors is an iDynTree SensorList object
*/
void setSensorList(const iDynTree::SensorsList& sensorList);
void setModelAndSensors(const iDynTree::Model& model, const iDynTree::SensorsList& sensors);

/**
* @brief set kinDyn
Expand All @@ -261,13 +310,19 @@ class SubModelCreator
*/

/**
* @brief get subModelList
* @brief access the length of the list std::vector<SubModel>.
* @return the number of sub-models composing the model
*/
std::size_t getNrOfSubModels() const;

/**
* @brief get the `std::vector<SubModel>` list.
* @return the list of SubModel objects.
*/
const std::vector<SubModel>& getSubModelList() const;

/**
* @brief get subModel
* @brief get a `SubModel` instance of the list of `SubModel`.
* @return the SubModel at the position index.
*/
const SubModel& getSubModel(int index) const;
Expand Down
Loading

0 comments on commit f3241a5

Please sign in to comment.