idyntree icon indicating copy to clipboard operation
idyntree copied to clipboard

Add the possibility to add/remove sensors from Berdy

Open lrapetti opened this issue 5 years ago • 1 comments

Currently in BERDY is using internally sensors defined as BerdySensorTypes. Those sensor types can be be:

  • copy of iDynTree::sensorsType
    SIX_AXIS_FORCE_TORQUE_SENSOR = SIX_AXIS_FORCE_TORQUE,
    ACCELEROMETER_SENSOR = ACCELEROMETER,
    GYROSCOPE_SENSOR = GYROSCOPE,
    THREE_AXIS_ANGULAR_ACCELEROMETER_SENSOR = 
    THREE_AXIS_ANGULAR_ACCELEROMETER,
    THREE_AXIS_FORCE_TORQUE_CONTACT_SENSOR  = 
    THREE_AXIS_FORCE_TORQUE_CONTACT,
    
  • custom sensor used in berdy ("berdy specific sensors")
  DOF_ACCELERATION_SENSOR = 1000,
  DOF_TORQUE_SENSOR       = 1001,
  NET_EXT_WRENCH_SENSOR   = 1002,
  JOINT_WRENCH_SENSOR     = 1003

Those sensor are add to the BerdyHelper in the init() function and are add accordingly to the type in two way:

  • trough a SensorsList that is a list of iDynTree::sensorType(that for example can be extracted from an URDF). For the sensor list we are able to add/remove object from the list before passing it to the init()
  • The berdy specific sensor are add accordingly to some berdy option passed to the init(). Those options allows only to select all/select none of the berdy specific sensors:
    includeAllJointAccelerationsAsSensors(),
    includeAllJointTorquesAsSensors(),
    includeAllNetExternalWrenchesAsSensors(),
    
    (only the joint wrench are selected in a different way by filling a vector containing the joint for which the sensor exist, see: https://github.com/robotology/idyntree/blob/devel/src/estimation/include/iDynTree/Estimation/BerdyHelper.h#L222)

What is missing is the possibility of adding/removing a single sensor from the berdy specific sensors. There are multiple way to do that, those are some options:

  • One solution may be to use a sensor list inside the berdyOption similarly to what done for the JOINT_WRENCH_SENSOR so that the sensor can be add one by one in the BerdyOption, or add all and then eventually removed.
  • build a vector of berdy sensor that may be build trough options and iDynTree sensors, and that can be access to add/remove sensor. And then pass this vector to the BerdyHelper::init()
  • Use all the sensor as iDynTree sensors (adding the missing sensors)

lrapetti avatar Oct 03 '19 09:10 lrapetti

Any one of the proposed solution seems fine to me. Feel free to propose a PR, thanks!

traversaro avatar Jan 08 '20 16:01 traversaro