struct
Impl
Public types
- struct ControlBoardRemapperInterfaces
- Struct holding remapped remote control board interfaces.
- struct ControlBoardRemapperMeasures
- Struct holding measurements polled from remapped remote control board interfaces.
- struct MASForceTorquesInterface
- Struct holding remapped MAS interfaces - FT sensors related.
- struct MASInertialsInterface
- Struct holding remapped MAS interfaces -inertial sensors related.
- struct MASSensorIndexMaps
- using StampedYARPVector = std::pair<yarp::sig::Vector, double>
-
using SubConfigLoader = bool(YarpSensorBridge::Impl::*)(std::weak_ptr<const BipedalLocomotion::
ParametersHandler:: IParametersHandler>, SensorBridgeMetaData&)
Public functions
- auto getIndexFromVector(const std::vector<std::string>& vec, const std::string& query, int& index) -> bool
- Utility function to get index from vector.
- auto nanExistsInVec(Eigen::Ref<const Eigen::VectorXd> vec, std::string_view logPrefix, const std::string& sensorName) -> bool
- Utility function to check for nan in vector.
-
auto subConfigLoader(const std::string& enableStreamString,
const std::string& streamGroupString,
const SubConfigLoader loader,
std::weak_ptr<const ParametersHandler::
IParametersHandler> handler, SensorBridgeMetaData& metaData, bool& enableStreamFlag) -> bool - Checks is a stream is enabled in configuration and loads the relevant stream group from configuration.
-
auto configureRemoteControlBoardRemapper(std::weak_ptr<const ParametersHandler::
IParametersHandler> handler, SensorBridgeMetaData& metaData) -> bool - Configure remote control board remapper meta data Related to kinematics and other joint/motor relevant quantities.
-
auto configureInertialSensors(std::weak_ptr<const ParametersHandler::
IParametersHandler> handler, SensorBridgeMetaData& metaData) -> bool - Configure inertial sensors meta data.
-
auto configureSixAxisForceTorqueSensors(std::weak_ptr<const ParametersHandler::
IParametersHandler> handler, SensorBridgeMetaData& metaData) -> bool - Configure six axis force torque sensors meta data.
-
auto configureCartesianWrenches(std::weak_ptr<const ParametersHandler::
IParametersHandler> handler, SensorBridgeMetaData& metaData) -> bool - Configure cartesian wrenches meta data.
-
auto configureTemperatureSensors(std::weak_ptr<const ParametersHandler::
IParametersHandler> handler, SensorBridgeMetaData& metaData) -> bool - Configure temperature sensors meta data.
-
template<typename SensorType>auto attachGenericOrAnalogSensor(const yarp::dev::PolyDriverList& devList, const std::string& sensorName, const int& nrChannelsInSensor, std::unordered_map<std::string, SensorType*>& sensorMap) -> bool
- Attach device with IGenericSensor or IAnalogSensor interfaces Important assumptions here,.
-
template<typename SensorType>auto attachAllGenericOrAnalogSensors(const yarp::dev::PolyDriverList& devList, std::unordered_map<std::string, SensorType*>& sensorMap, const int& nrChannelsInSensor, const std::vector<std::string>& sensorList, std::string_view interfaceType) -> bool
-
template<typename MASSensorType>auto attachAndCheckMASSensors(const yarp::dev::PolyDriverList& devList, MASSensorType*& sensorInterface, const std::vector<std::string>& sensorList, const std::string_view interfaceName) -> bool
- Attach Remapped Multiple Analog Sensor Interfaces and check available sensors.
-
template<typename MASSensorType>auto attachRemappedMASSensor(const yarp::dev::PolyDriverList& devList, MASSensorType*& masSensorInterface) -> bool
- Attach Remapped Multiple Analog Sensor Interfaces Looks for a specific MAS Sensor interface in the attached MAS Remapper.
-
template<typename MASSensorType>auto checkAttachedMASSensors(const yarp::dev::PolyDriverList& devList, MASSensorType*& sensorInterface, const std::vector<std::string>& sensorList) -> bool
- Check if all the desired MAS sensors are available in the attached MAS interface.
-
template<typename MASSensorType>auto getNumberOfMASSensors(MASSensorType*& sensorInterface) -> std::size_t
- Get number of MAS Sensors.
-
template<typename MASSensorType>auto getMASSensorName(MASSensorType*& sensorInterface, const std::size_t& sensIdx, std::string& sensorName) -> bool
- Get name of MAS Sensors.
-
template<typename MASSensorType>auto getAllSensorsInMASInterface(MASSensorType* sensorInterface) -> std::vector<std::string>
- Get all sensor names in a MAS Inerface.
-
template<typename SensorType>auto checkSensor(const std::unordered_map<std::string, SensorType*>& sensorMap, const std::string& sensorName) -> bool
- Check if sensor is available in the relevant sensor map.
-
template<typename YARPDataType>auto checkValidSensorMeasure(std::string_view logPrefix, const std::unordered_map<std::string, YARPDataType>& sensorMap, const std::string& sensorName) -> bool
- Check if sensor is available in the relevant sensor measurement map.
- auto checkValid(const std::string_view methodName) -> bool
- Check if the bridge is successfully initialized and attached to required device drivers.
-
template<typename ControlBoardInterface>auto checkControlBoardSensor(const std::string logPrefix, ControlBoardInterface* interface, const bool& streamConfig, Eigen::Ref<const Eigen::VectorXd> measureBuffer) -> bool
- auto attachAllInertials(const yarp::dev::PolyDriverList& devList) -> bool
- Attach generic IMU sensor types and MAS inertials.
- auto attachRemappedRemoteControlBoard(const yarp::dev::PolyDriverList& devList) -> bool
- Attach a remapped control board and check the availability of desired interface Further, resize joint data buffers and check if the control board joints list and the desired joints list match Also, maintain a remapping index buffer for adapting to arbitrary joint list serializations.
- void resetControlBoardBuffers()
- resize and set control board buffers to zero
- auto compareControlBoardJointsList() -> bool
- check and match control board joints with the sensorbridge joints list
- auto attachAllSixAxisForceTorqueSensors(const yarp::dev::PolyDriverList& devList) -> bool
- auto attachAllTemperatureSensors(const yarp::dev::PolyDriverList& devList) -> bool
- auto attachCartesianWrenchInterface(const yarp::dev::PolyDriverList& devList) -> bool
- Attach to cartesian wrench interface.
- auto deg2rad(double deg) -> double
- utility function
-
template<typename SensorType>auto readAnalogOrGenericSensor(const std::string& sensorName, const int& nrChannelsInYARPSensor, std::unordered_map<std::string, SensorType*>& interfaceMap, std::unordered_map<std::string, StampedYARPVector>& measurementMap, bool checkForNan = false) -> bool
- Read generic or analog sensor stream and update internal measurement buffer.
-
template<typename MASSensorType>auto readMASSensor(MASSensorType* interface, const std::string& sensorName, const std::size_t sensorIdx, std::unordered_map<std::string, StampedYARPVector>& measurementMap, bool checkForNan = false) -> bool
-
template<typename MASSensorType>auto readAllMASSensors(MASSensorType* interface, std::unordered_map<std::string, std::size_t> sensIdxMap, std::unordered_map<std::string, StampedYARPVector>& measurementMap, std::vector<std::string>& failedSensorReads, bool checkForNan = false) -> bool
- auto readControlBoardInterface(bool checkForNan = false) -> bool
- Read control board remapper interfaces.
- auto readAllJointSensors(bool checkForNan = false, bool streamJointAccelerations = true) -> bool
- Read joint sensors measurements.
- auto readAllMotorSensors(bool checkForNan = false) -> bool
- Read motor sensors measurements.
- auto readAllMotorPWMs(bool checkForNan = false) -> bool
- Read motor encoders measurements.
- auto readAllPIDs(bool checkForNan = false) -> bool
- Read pid references.
- auto readAllIMUs(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllCartesianWrenches(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllMASLinearAccelerometers(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllMASGyroscopes(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllMASOrientationSensors(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllMASMagnetometers(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllMASSixAxisForceTorqueSensors(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllAnalogSixAxisForceTorqueSensors(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllMASTemperatures(std::vector<std::string>& failedSensorReads) -> bool
- auto readAllSensors(std::vector<std::string>& failedReadAllSensors) -> bool
Public variables
- ControlBoardRemapperInterfaces controlBoardRemapperInterfaces
- MASInertialsInterface masInertialsInterface
- MASForceTorquesInterface masForceTorquesInterface
- MASSensorIndexMaps masSensorIndexMaps
- ControlBoardRemapperMeasures controlBoardRemapperMeasures
- map of IMU sensors attached through generic sensor interfaces
- std::unordered_map<std::string, yarp::dev::IGenericSensor*> analogIMUInterface
- map of cartesian wrench streams attached through generic sensor interfaces
- std::unordered_map<std::string, yarp::dev::IGenericSensor*> cartesianWrenchInterface
- map of six axis force torque sensors attached through analog sensor interfaces
- std::unordered_map<std::string, yarp::dev::IAnalogSensor*> analogSixAxisFTSensorsInterface
- std::unordered_map<std::string, StampedYARPVector> IMUMeasures
- < map holding analog IMU sensor measurements (Used only for analog sensor interfaces)
- std::unordered_map<std::string, StampedYARPVector> FTMeasures
- maps holding three axis inertial sensor measures
- std::unordered_map<std::string, StampedYARPVector> gyroMeasures
- std::unordered_map<std::string, StampedYARPVector> accelerometerMeasures
- std::unordered_map<std::string, StampedYARPVector> orientationMeasures
- std::unordered_map<std::string, StampedYARPVector> magnetometerMeasures
- map holding cartesian wrench measures
- std::unordered_map<std::string, StampedYARPVector> cartesianWrenchMeasures
- map holding temperature measures
- std::unordered_map<std::string, StampedYARPVector> temperatureMeasures
- const int nrChannelsInYARPGenericIMUSensor
- const int nrChannelsInYARPGenericCartesianWrench
- const int nrChannelsInYARPAnalogSixAxisFTSensor
- std::vector<std::string> failedSensorReads
- SensorBridgeMetaData metaData
- struct holding meta data
- bool bridgeInitialized
- flag set to true if the bridge is successfully initialized
- bool driversAttached
- flag set to true if the bridge is successfully attached to required device drivers
- bool checkForNAN
- flag to enable search for NANs in the incoming measurement buffers
- bool streamJointAccelerations
- flag to enable reading joint accelerations from encoders
Function documentation
template<typename SensorType>
bool BipedalLocomotion:: RobotInterface:: YarpSensorBridge:: Impl:: attachGenericOrAnalogSensor(const yarp::dev::PolyDriverList& devList,
const std::string& sensorName,
const int& nrChannelsInSensor,
std::unordered_map<std::string, SensorType*>& sensorMap)
Attach device with IGenericSensor or IAnalogSensor interfaces Important assumptions here,.
- Any generic sensor with 12 channels is a IMU sensor
- Any generic sensor with 6 channels is a cartesian wrench sensor
- Any analog sensor with 6 channels is a six axis force torque sensor
Variable documentation
std::unordered_map<std::string, StampedYARPVector> BipedalLocomotion:: RobotInterface:: YarpSensorBridge:: Impl:: IMUMeasures
< map holding analog IMU sensor measurements (Used only for analog sensor interfaces)
map holding six axis force torque measures