iCub-main
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
CanBusFtSensor Class Reference

canbusftsensor : driver for CAN communication with IIT's analog sensor boards, including the MAIS and STRAIN boards. More...

#include <CanBusFtSensor.h>

+ Inheritance diagram for CanBusFtSensor:

Public Member Functions

 CanBusFtSensor (int period=20)
 
 ~CanBusFtSensor ()
 
virtual bool open (yarp::os::Searchable &config)
 
virtual bool close ()
 
virtual bool threadInit ()
 
virtual void threadRelease ()
 
virtual void run ()
 
virtual size_t getNrOfSixAxisForceTorqueSensors () const override
 
virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus (size_t sens_index) const override
 
virtual bool getSixAxisForceTorqueSensorName (size_t sens_index, std::string &name) const override
 
virtual bool getSixAxisForceTorqueSensorFrameName (size_t sens_index, std::string &frameName) const override
 
virtual bool getSixAxisForceTorqueSensorMeasure (size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
 

Protected Attributes

PolyDriver driver
 
ICanBus * pCanBus
 
ICanBufferFactory * pCanBufferFactory
 
CanBuffer inBuffer
 
CanBuffer outBuffer
 
int canDeviceNum
 
std::mutex mtx
 
unsigned int channelsNum
 
unsigned short boardId
 
short status
 
double timeStamp
 
AnalogDataFormat dataFormat
 
yarp::sig::Vector data
 
yarp::sig::Vector scaleFactor
 
unsigned short useCalibration
 
bool diagnostic
 
std::string sensorName
 
std::string frameName
 

Detailed Description

canbusftsensor : driver for CAN communication with IIT's analog sensor boards, including the MAIS and STRAIN boards.

YARP device name
canbusftsensor

Parameters accepted in the config argument of the open method:

Parameter name Type Units Default Value Required Description Notes
canbusDevice string - - Yes Yarp device name of CAN Bus wrapper -
physDevice string - - Yes Yarp device name for the low level CAN device driver -
canDeviceNum int - - Yes ID of the CAN Bus line -
canAddress int - - Yes CAN Bus Address for the sensor board -
format int bits - Yes Format (i.e. number of bits) of analog data transmitted on the CAN bus (16 for STRAIN board, 8 for MAIS board) -
period int ms - Yes Publication period (in ms) of the sensor reading on the Can Bus -
channels int - - Yes Number of output channels of the sensor (6 for STRAIN board, 16 for MAIS board) -
useCalibration int - - No If useCalibration is present and set to 1 output the calibrated readings, otherwise output the raw values -
diagnostic int - - No If diagnostic is present and set to 1 properly return the state of the sensor, otherwise always return MAS_status::MAS_OK -
sensorName string - - Yes Unique name of the sensor -
frameName string - unknown_frame_name No Name of the robot link to which the sensor is attached Many sensors can be attached to the same frame link. The parameter is typically used in ROS message headers and should match a valid frame link name defined in the robot model (.sdf / .urdf). If wrongly assigned, ROS will not work properly.

Definition at line 44 of file CanBusFtSensor.h.

Constructor & Destructor Documentation

◆ CanBusFtSensor()

CanBusFtSensor::CanBusFtSensor ( int  period = 20)
inline

Definition at line 87 of file CanBusFtSensor.h.

◆ ~CanBusFtSensor()

CanBusFtSensor::~CanBusFtSensor ( )
inline

Definition at line 91 of file CanBusFtSensor.h.

Member Function Documentation

◆ close()

bool CanBusFtSensor::close ( )
virtual

Definition at line 296 of file CanBusFtSensor.cpp.

◆ getNrOfSixAxisForceTorqueSensors()

size_t CanBusFtSensor::getNrOfSixAxisForceTorqueSensors ( ) const
overridevirtual

Definition at line 483 of file CanBusFtSensor.cpp.

◆ getSixAxisForceTorqueSensorFrameName()

bool CanBusFtSensor::getSixAxisForceTorqueSensorFrameName ( size_t  sens_index,
std::string &  frameName 
) const
overridevirtual

Definition at line 499 of file CanBusFtSensor.cpp.

◆ getSixAxisForceTorqueSensorMeasure()

bool CanBusFtSensor::getSixAxisForceTorqueSensorMeasure ( size_t  sens_index,
yarp::sig::Vector &  out,
double &  timestamp 
) const
overridevirtual

Definition at line 505 of file CanBusFtSensor.cpp.

◆ getSixAxisForceTorqueSensorName()

bool CanBusFtSensor::getSixAxisForceTorqueSensorName ( size_t  sens_index,
std::string &  name 
) const
overridevirtual

Definition at line 493 of file CanBusFtSensor.cpp.

◆ getSixAxisForceTorqueSensorStatus()

yarp::dev::MAS_status CanBusFtSensor::getSixAxisForceTorqueSensorStatus ( size_t  sens_index) const
overridevirtual

Definition at line 488 of file CanBusFtSensor.cpp.

◆ open()

bool CanBusFtSensor::open ( yarp::os::Searchable &  config)
virtual

Definition at line 19 of file CanBusFtSensor.cpp.

◆ run()

void CanBusFtSensor::run ( )
virtual

Definition at line 405 of file CanBusFtSensor.cpp.

◆ threadInit()

bool CanBusFtSensor::threadInit ( )
virtual

Definition at line 315 of file CanBusFtSensor.cpp.

◆ threadRelease()

void CanBusFtSensor::threadRelease ( )
virtual

Definition at line 477 of file CanBusFtSensor.cpp.

Member Data Documentation

◆ boardId

unsigned short CanBusFtSensor::boardId
protected

Definition at line 75 of file CanBusFtSensor.h.

◆ canDeviceNum

int CanBusFtSensor::canDeviceNum
protected

Definition at line 70 of file CanBusFtSensor.h.

◆ channelsNum

unsigned int CanBusFtSensor::channelsNum
protected

Definition at line 74 of file CanBusFtSensor.h.

◆ data

yarp::sig::Vector CanBusFtSensor::data
protected

Definition at line 79 of file CanBusFtSensor.h.

◆ dataFormat

AnalogDataFormat CanBusFtSensor::dataFormat
protected

Definition at line 78 of file CanBusFtSensor.h.

◆ diagnostic

bool CanBusFtSensor::diagnostic
protected

Definition at line 82 of file CanBusFtSensor.h.

◆ driver

PolyDriver CanBusFtSensor::driver
protected

Definition at line 65 of file CanBusFtSensor.h.

◆ frameName

std::string CanBusFtSensor::frameName
protected

Definition at line 84 of file CanBusFtSensor.h.

◆ inBuffer

CanBuffer CanBusFtSensor::inBuffer
protected

Definition at line 68 of file CanBusFtSensor.h.

◆ mtx

std::mutex CanBusFtSensor::mtx
mutableprotected

Definition at line 72 of file CanBusFtSensor.h.

◆ outBuffer

CanBuffer CanBusFtSensor::outBuffer
protected

Definition at line 69 of file CanBusFtSensor.h.

◆ pCanBufferFactory

ICanBufferFactory* CanBusFtSensor::pCanBufferFactory
protected

Definition at line 67 of file CanBusFtSensor.h.

◆ pCanBus

ICanBus* CanBusFtSensor::pCanBus
protected

Definition at line 66 of file CanBusFtSensor.h.

◆ scaleFactor

yarp::sig::Vector CanBusFtSensor::scaleFactor
protected

Definition at line 80 of file CanBusFtSensor.h.

◆ sensorName

std::string CanBusFtSensor::sensorName
protected

Definition at line 83 of file CanBusFtSensor.h.

◆ status

short CanBusFtSensor::status
protected

Definition at line 76 of file CanBusFtSensor.h.

◆ timeStamp

double CanBusFtSensor::timeStamp
protected

Definition at line 77 of file CanBusFtSensor.h.

◆ useCalibration

unsigned short CanBusFtSensor::useCalibration
protected

Definition at line 81 of file CanBusFtSensor.h.


The documentation for this class was generated from the following files: