fakeLaserWithMotor
: fake sensor device driver for testing purposes and reference for IRangefinder2D devices.
More...
#include <fake/fakeLaserWithMotor/FakeLaserWithMotor.h>
Public Member Functions | |
FakeLaserWithMotor (double period=0.02) | |
~FakeLaserWithMotor () | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. | |
bool | close () override |
Close the DeviceDriver. | |
bool | threadInit () override |
Initialization method. | |
void | threadRelease () override |
Release method. | |
void | run () override |
Loop function. | |
bool | setDistanceRange (double min, double max) override |
set the device detection range. | |
bool | setScanLimits (double min, double max) override |
set the scan angular range. | |
bool | setHorizontalResolution (double step) override |
get the angular step between two measurements (if available) | |
bool | setScanRate (double rate) override |
set the scan rate (scans per seconds) | |
bool | alloc (int njoints) |
bool | dealloc () |
bool | resetEncoderRaw (int j) override |
Reset encoder, single joint. | |
bool | resetEncodersRaw () override |
Reset encoders. | |
bool | setEncoderRaw (int j, double val) override |
Set the value of the encoder for a given joint. | |
bool | setEncodersRaw (const double *vals) override |
Set the value of all encoders. | |
bool | getEncoderRaw (int j, double *v) override |
Read the value of an encoder. | |
bool | getEncodersRaw (double *encs) override |
Read the position of all axes. | |
bool | getEncoderSpeedRaw (int j, double *sp) override |
Read the instantaneous speed of an axis. | |
bool | getEncoderSpeedsRaw (double *spds) override |
Read the instantaneous acceleration of an axis. | |
bool | getEncoderAccelerationRaw (int j, double *spds) override |
Read the instantaneous acceleration of an axis. | |
bool | getEncoderAccelerationsRaw (double *accs) override |
Read the instantaneous acceleration of all axes. | |
bool | getEncodersTimedRaw (double *encs, double *stamps) override |
Read the instantaneous acceleration of all axes. | |
bool | getEncoderTimedRaw (int j, double *encs, double *stamp) override |
Read the instantaneous acceleration of all axes. | |
bool | getAxes (int *ax) override |
Get the number of controlled axes. | |
bool | positionMoveRaw (int j, double ref) override |
Set new reference point for a single axis. | |
bool | positionMoveRaw (const double *refs) override |
Set new reference point for all axes. | |
bool | relativeMoveRaw (int j, double delta) override |
Set relative position. | |
bool | relativeMoveRaw (const double *deltas) override |
Set relative position, all joints. | |
bool | checkMotionDoneRaw (bool *flag) override |
Check if the current trajectory is terminated. | |
bool | checkMotionDoneRaw (int j, bool *flag) override |
Check if the current trajectory is terminated. | |
bool | setRefSpeedRaw (int j, double sp) override |
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory. | |
bool | setRefSpeedsRaw (const double *spds) override |
Set reference speed on all joints. | |
bool | setRefAccelerationRaw (int j, double acc) override |
Set reference acceleration for a joint. | |
bool | setRefAccelerationsRaw (const double *accs) override |
Set reference acceleration on all joints. | |
bool | getRefSpeedRaw (int j, double *ref) override |
Get reference speed for a joint. | |
bool | getRefSpeedsRaw (double *spds) override |
Get reference speed of all joints. | |
bool | getRefAccelerationRaw (int j, double *acc) override |
Get reference acceleration for a joint. | |
bool | getRefAccelerationsRaw (double *accs) override |
Get reference acceleration of all joints. | |
bool | stopRaw (int j) override |
Stop motion, single joint. | |
bool | stopRaw () override |
Stop motion, multiple joints. | |
bool | positionMoveRaw (const int n_joint, const int *joints, const double *refs) override |
Set new reference point for a subset of joints. | |
bool | relativeMoveRaw (const int n_joint, const int *joints, const double *deltas) override |
Set relative position for a subset of joints. | |
bool | checkMotionDoneRaw (const int n_joint, const int *joints, bool *flags) override |
Check if the current trajectory is terminated. | |
bool | setRefSpeedsRaw (const int n_joint, const int *joints, const double *spds) override |
Set reference speed on all joints. | |
bool | setRefAccelerationsRaw (const int n_joint, const int *joints, const double *accs) override |
Set reference acceleration on all joints. | |
bool | getRefSpeedsRaw (const int n_joint, const int *joints, double *spds) override |
Get reference speed of all joints. | |
bool | getRefAccelerationsRaw (const int n_joint, const int *joints, double *accs) override |
Get reference acceleration for a joint. | |
bool | stopRaw (const int n_joint, const int *joints) override |
Stop motion for subset of joints. | |
bool | getTargetPositionRaw (const int joint, double *ref) override |
Get the last position reference for the specified axis. | |
bool | getTargetPositionsRaw (double *refs) override |
Get the last position reference for all axes. | |
bool | getTargetPositionsRaw (const int n_joint, const int *joints, double *refs) override |
Get the last position reference for the specified group of axes. | |
bool | getControlModeRaw (int j, int *v) override |
bool | getControlModesRaw (int *v) override |
bool | getControlModesRaw (const int n_joint, const int *joints, int *modes) override |
bool | setControlModeRaw (const int j, const int mode) override |
bool | setControlModesRaw (const int n_joint, const int *joints, int *modes) override |
bool | setControlModesRaw (int *modes) override |
bool | velocityMoveRaw (int j, double sp) override |
Start motion at a given speed, single joint. | |
bool | velocityMoveRaw (const double *sp) override |
Start motion at a given speed, multiple joints. | |
bool | velocityMoveRaw (const int n_joint, const int *joints, const double *spds) override |
Start motion at a given speed for a subset of joints. | |
bool | getRefVelocityRaw (const int joint, double *ref) override |
Get the last reference speed set by velocityMove for single joint. | |
bool | getRefVelocitiesRaw (double *refs) override |
Get the last reference speed set by velocityMove for all joints. | |
bool | getRefVelocitiesRaw (const int n_joint, const int *joints, double *refs) override |
Get the last reference speed set by velocityMove for a group of joints. | |
bool | getAxisNameRaw (int axis, std::string &name) override |
bool | getJointTypeRaw (int axis, yarp::dev::JointTypeEnum &type) override |
bool | acquireDataFromHW () override final |
This method should be implemented by the user, and contain the logic to grab data from the hardware. | |
bool | read (yarp::os::ConnectionReader &connection) override |
Read this object from a network connection. | |
Public Member Functions inherited from yarp::os::PeriodicThread | |
PeriodicThread (double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative) | |
Constructor. | |
PeriodicThread (double period, PeriodicThreadClock clockAccuracy) | |
Constructor. | |
virtual | ~PeriodicThread () |
bool | start () |
Call this to start the thread. | |
void | step () |
Call this to "step" the thread rather than starting it. | |
void | stop () |
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() called). | |
void | askToStop () |
Stop the thread. | |
bool | isRunning () const |
Returns true when the thread is started, false otherwise. | |
bool | isSuspended () const |
Returns true when the thread is suspended, false otherwise. | |
bool | setPeriod (double period) |
Set the (new) period of the thread. | |
double | getPeriod () const |
Return the current period of the thread. | |
void | suspend () |
Suspend the thread, the thread keeps running by doLoop is never executed. | |
void | resume () |
Resume the thread if previously suspended. | |
void | resetStat () |
Reset thread statistics. | |
double | getEstimatedPeriod () const |
Return estimated period since last reset. | |
void | getEstimatedPeriod (double &av, double &std) const |
Return estimated period since last reset. | |
unsigned int | getIterations () const |
Return the number of iterations performed since last reset. | |
double | getEstimatedUsed () const |
Return the estimated duration of the run() function since last reset. | |
void | getEstimatedUsed (double &av, double &std) const |
Return estimated duration of the run() function since last reset. | |
int | setPriority (int priority, int policy=-1) |
Set the priority and scheduling policy of the thread, if the OS supports that. | |
int | getPriority () const |
Query the current priority of the thread, if the OS supports that. | |
int | getPolicy () const |
Query the current scheduling policy of the thread, if the OS supports that. | |
Public Member Functions inherited from yarp::dev::Lidar2DDeviceBase | |
bool | parseConfiguration (yarp::os::Searchable &config) |
Lidar2DDeviceBase () | |
bool | getRawData (yarp::sig::Vector &data, double *timestamp=nullptr) override |
Get the device measurements. | |
bool | getLaserMeasurement (std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override |
Get the device measurements. | |
bool | getDeviceStatus (Device_status &status) override |
get the device status | |
bool | getDeviceInfo (std::string &device_info) override |
get the device hardware characteristics | |
bool | getDistanceRange (double &min, double &max) override |
get the device detection range | |
bool | getScanLimits (double &min, double &max) override |
get the scan angular range. | |
bool | getHorizontalResolution (double &step) override |
get the angular step between two measurements. | |
bool | getScanRate (double &rate) override |
get the scan rate (scans per seconds) | |
Public Member Functions inherited from yarp::dev::IRangefinder2D | |
virtual | ~IRangefinder2D () |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
DeviceDriver () | |
DeviceDriver (const DeviceDriver &other)=delete | |
DeviceDriver (DeviceDriver &&other) noexcept=delete | |
DeviceDriver & | operator= (const DeviceDriver &other)=delete |
DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
virtual | ~DeviceDriver () |
virtual std::string | id () const |
Return the id assigned to the PolyDriver. | |
virtual void | setId (const std::string &id) |
Set the id for this device. | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. | |
Public Member Functions inherited from yarp::os::PortReader | |
virtual | ~PortReader () |
Destructor. | |
virtual Type | getReadType () const |
Public Member Functions inherited from yarp::dev::IEncodersTimedRaw | |
virtual | ~IEncodersTimedRaw () |
Destructor. | |
Public Member Functions inherited from yarp::dev::IEncodersRaw | |
virtual | ~IEncodersRaw () |
Destructor. | |
Public Member Functions inherited from yarp::dev::IPositionControlRaw | |
virtual | ~IPositionControlRaw () |
Destructor. | |
Public Member Functions inherited from yarp::dev::IVelocityControlRaw | |
virtual | ~IVelocityControlRaw () |
Destructor. | |
Public Member Functions inherited from yarp::dev::IControlModeRaw | |
virtual | ~IControlModeRaw () |
Public Member Functions inherited from yarp::dev::IAxisInfoRaw | |
virtual | ~IAxisInfoRaw () |
Destructor. | |
Public Member Functions inherited from yarp::dev::StubImplInteractionModeRaw | |
virtual | ~StubImplInteractionModeRaw () |
Destructor. | |
bool | getInteractionModeRaw (int axis, yarp::dev::InteractionModeEnum *mode) override |
Get the current interaction mode of the robot, values can be stiff or compliant. | |
bool | getInteractionModesRaw (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override |
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant. | |
bool | getInteractionModesRaw (yarp::dev::InteractionModeEnum *modes) override |
Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant. | |
bool | setInteractionModeRaw (int axis, yarp::dev::InteractionModeEnum mode) override |
Set the interaction mode of the robot, values can be stiff or compliant. | |
bool | setInteractionModesRaw (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override |
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant. | |
bool | setInteractionModesRaw (yarp::dev::InteractionModeEnum *modes) override |
Set the interaction mode of the robot for a all the joints, values can be stiff or compliant. | |
Public Member Functions inherited from yarp::dev::IInteractionModeRaw | |
virtual | ~IInteractionModeRaw () |
Destructor. | |
Public Member Functions inherited from yarp::dev::ImplementPositionControl | |
ImplementPositionControl (yarp::dev::IPositionControlRaw *y) | |
Constructor. | |
virtual | ~ImplementPositionControl () |
Destructor. | |
bool | getAxes (int *axis) override |
Get the number of controlled axes. | |
bool | positionMove (int j, double ref) override |
Set new reference point for a single axis. | |
bool | positionMove (const int n_joint, const int *joints, const double *refs) override |
Set new reference point for a subset of joints. | |
bool | positionMove (const double *refs) override |
Set new reference point for all axes. | |
bool | relativeMove (int j, double delta) override |
Set relative position. | |
bool | relativeMove (const int n_joint, const int *joints, const double *deltas) override |
Set relative position for a subset of joints. | |
bool | relativeMove (const double *deltas) override |
Set relative position, all joints. | |
bool | checkMotionDone (bool *flag) override |
Check if the current trajectory is terminated. | |
bool | checkMotionDone (const int n_joint, const int *joints, bool *flags) override |
Check if the current trajectory is terminated. | |
bool | checkMotionDone (int j, bool *flag) override |
Check if the current trajectory is terminated. | |
bool | setRefSpeed (int j, double sp) override |
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory. | |
bool | setRefSpeeds (const int n_joint, const int *joints, const double *spds) override |
Set reference speed on all joints. | |
bool | setRefSpeeds (const double *spds) override |
Set reference speed on all joints. | |
bool | setRefAcceleration (int j, double acc) override |
Set reference acceleration for a joint. | |
bool | setRefAccelerations (const int n_joint, const int *joints, const double *accs) override |
Set reference acceleration on all joints. | |
bool | setRefAccelerations (const double *accs) override |
Set reference acceleration on all joints. | |
bool | getRefSpeed (int j, double *ref) override |
Get reference speed for a joint. | |
bool | getRefSpeeds (const int n_joint, const int *joints, double *spds) override |
Get reference speed of all joints. | |
bool | getRefSpeeds (double *spds) override |
Get reference speed of all joints. | |
bool | getRefAcceleration (int j, double *acc) override |
Get reference acceleration for a joint. | |
bool | getRefAccelerations (const int n_joint, const int *joints, double *accs) override |
Get reference acceleration for a joint. | |
bool | getRefAccelerations (double *accs) override |
Get reference acceleration of all joints. | |
bool | stop (int j) override |
Stop motion, single joint. | |
bool | stop (const int n_joint, const int *joints) override |
Stop motion for subset of joints. | |
bool | stop () override |
Stop motion, multiple joints. | |
bool | getTargetPosition (const int joint, double *ref) override |
Get the last position reference for the specified axis. | |
bool | getTargetPositions (double *refs) override |
Get the last position reference for all axes. | |
bool | getTargetPositions (const int n_joint, const int *joints, double *refs) override |
Get the last position reference for the specified group of axes. | |
Public Member Functions inherited from yarp::dev::IPositionControl | |
virtual | ~IPositionControl () |
Destructor. | |
Public Member Functions inherited from yarp::dev::ImplementVelocityControl | |
ImplementVelocityControl (yarp::dev::IVelocityControlRaw *y) | |
Constructor. | |
virtual | ~ImplementVelocityControl () |
Destructor. | |
bool | getAxes (int *axes) override |
Get the number of controlled axes. | |
bool | velocityMove (int j, double sp) override |
Start motion at a given speed, single joint. | |
bool | velocityMove (const double *sp) override |
Start motion at a given speed, multiple joints. | |
bool | setRefAcceleration (int j, double acc) override |
Set reference acceleration for a joint. | |
bool | setRefAccelerations (const double *accs) override |
Set reference acceleration on all joints. | |
bool | getRefAcceleration (int j, double *acc) override |
Get reference acceleration for a joint. | |
bool | getRefAccelerations (double *accs) override |
Get reference acceleration of all joints. | |
bool | stop (int j) override |
Stop motion, single joint. | |
bool | stop () override |
Stop motion, multiple joints. | |
bool | velocityMove (const int n_joint, const int *joints, const double *spds) override |
Start motion at a given speed for a subset of joints. | |
bool | getRefVelocity (const int joint, double *vel) override |
Get the last reference speed set by velocityMove for single joint. | |
bool | getRefVelocities (double *vels) override |
Get the last reference speed set by velocityMove for all joints. | |
bool | getRefVelocities (const int n_joint, const int *joints, double *vels) override |
Get the last reference speed set by velocityMove for a group of joints. | |
bool | setRefAccelerations (const int n_joint, const int *joints, const double *accs) override |
Set reference acceleration for a subset of joints. | |
bool | getRefAccelerations (const int n_joint, const int *joints, double *accs) override |
Get reference acceleration for a subset of joints. | |
bool | stop (const int n_joint, const int *joints) override |
Stop motion for a subset of joints. | |
Public Member Functions inherited from yarp::dev::IVelocityControl | |
virtual | ~IVelocityControl () |
Destructor. | |
Public Member Functions inherited from yarp::dev::ImplementControlMode | |
bool | initialize (int k, const int *amap) |
bool | uninitialize () |
ImplementControlMode (IControlModeRaw *v) | |
~ImplementControlMode () | |
bool | getControlMode (int j, int *f) override |
Get the current control mode. | |
bool | getControlModes (int *modes) override |
Get the current control mode (multiple joints). | |
bool | getControlModes (const int n_joint, const int *joints, int *modes) override |
Get the current control mode for a subset of axes. | |
bool | setControlMode (const int j, const int mode) override |
Set the current control mode. | |
bool | setControlModes (const int n_joint, const int *joints, int *modes) override |
Set the current control mode for a subset of axes. | |
bool | setControlModes (int *modes) override |
Set the current control mode (multiple joints). | |
Public Member Functions inherited from yarp::dev::IControlMode | |
virtual | ~IControlMode () |
Public Member Functions inherited from yarp::dev::ImplementInteractionMode | |
ImplementInteractionMode (yarp::dev::IInteractionModeRaw *Class_p) | |
Constructor. | |
virtual | ~ImplementInteractionMode () |
Destructor. | |
bool | getInteractionMode (int axis, yarp::dev::InteractionModeEnum *mode) override |
Get the current interaction mode of the robot, values can be stiff or compliant. | |
bool | getInteractionModes (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override |
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant. | |
bool | getInteractionModes (yarp::dev::InteractionModeEnum *modes) override |
Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant. | |
bool | setInteractionMode (int axis, yarp::dev::InteractionModeEnum mode) override |
Set the interaction mode of the robot, values can be stiff or compliant. | |
bool | setInteractionModes (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override |
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant. | |
bool | setInteractionModes (yarp::dev::InteractionModeEnum *modes) override |
Set the interaction mode of the robot for a all the joints, values can be stiff or compliant. | |
Public Member Functions inherited from yarp::dev::IInteractionMode | |
virtual | ~IInteractionMode () |
Destructor. | |
Public Member Functions inherited from yarp::dev::ImplementEncodersTimed | |
ImplementEncodersTimed (yarp::dev::IEncodersTimedRaw *y) | |
virtual | ~ImplementEncodersTimed () |
bool | getAxes (int *ax) override |
Get the number of controlled axes. | |
bool | resetEncoder (int j) override |
Reset encoder, single joint. | |
bool | resetEncoders () override |
Reset encoders. | |
bool | setEncoder (int j, double val) override |
Set the value of the encoder for a given joint. | |
bool | setEncoders (const double *vals) override |
Set the value of all encoders. | |
bool | getEncoder (int j, double *v) override |
Read the value of an encoder. | |
bool | getEncodersTimed (double *encs, double *time) override |
Read the instantaneous acceleration of all axes. | |
bool | getEncoderTimed (int j, double *v, double *t) override |
Read the instantaneous acceleration of all axes. | |
bool | getEncoders (double *encs) override |
Read the position of all axes. | |
bool | getEncoderSpeed (int j, double *spds) override |
Read the istantaneous speed of an axis. | |
bool | getEncoderSpeeds (double *spds) override |
Read the instantaneous speed of all axes. | |
bool | getEncoderAcceleration (int j, double *spds) override |
Read the instantaneous acceleration of an axis. | |
bool | getEncoderAccelerations (double *accs) override |
Read the instantaneous acceleration of all axes. | |
Public Member Functions inherited from yarp::dev::IEncodersTimed | |
virtual | ~IEncodersTimed () |
Destructor. | |
Public Member Functions inherited from yarp::dev::IEncoders | |
virtual | ~IEncoders () |
Destructor. | |
Public Member Functions inherited from yarp::dev::ImplementAxisInfo | |
ImplementAxisInfo (yarp::dev::IAxisInfoRaw *y) | |
virtual | ~ImplementAxisInfo () |
bool | getAxes (int *ax) override |
Get the number of controlled axes. | |
bool | getAxisName (int axis, std::string &name) override |
bool | getJointType (int axis, yarp::dev::JointTypeEnum &type) override |
Public Member Functions inherited from yarp::dev::IAxisInfo | |
virtual | ~IAxisInfo () |
Destructor. | |
Public Member Functions inherited from FakeLaserWithMotor_ParamsParser | |
FakeLaserWithMotor_ParamsParser () | |
~FakeLaserWithMotor_ParamsParser () override=default | |
bool | parseParams (const yarp::os::Searchable &config) override |
Parse the DeviceDriver parameters. | |
std::string | getDeviceClassName () const override |
Get the name of the DeviceDriver class. | |
std::string | getDeviceName () const override |
Get the name of the device (i.e. | |
std::string | getDocumentationOfDeviceParams () const override |
Get the documentation of the DeviceDriver's parameters. | |
std::vector< std::string > | getListOfParams () const override |
Return a list of all params used by the device. | |
Public Member Functions inherited from yarp::dev::IDeviceDriverParams | |
virtual | ~IDeviceDriverParams () |
Public Attributes | |
std::string * | _axisName = nullptr |
yarp::dev::JointTypeEnum * | _jointType = nullptr |
int * | _controlModes = nullptr |
double * | _encoders = nullptr |
double * | _posCtrl_references = nullptr |
double * | _ref_speeds = nullptr |
double * | _command_speeds = nullptr |
double * | _ref_accs = nullptr |
Public Attributes inherited from FakeLaserWithMotor_ParamsParser | |
const std::string | m_device_classname = {"FakeLaserWithMotor"} |
const std::string | m_device_name = {"fakeLaserWithMotor"} |
bool | m_parser_is_strict = false |
const parser_version_type | m_parser_version = {} |
const std::string | m_test_defaultValue = {"use_pattern"} |
const std::string | m_localization_port_defaultValue = {"/fakeLaser/location:i"} |
const std::string | m_localization_server_defaultValue = {"/localizationServer"} |
const std::string | m_localization_client_defaultValue = {"/fakeLaser/localizationClient"} |
const std::string | m_localization_device_defaultValue = {"localization2DClient"} |
const std::string | m_MAP_MODE_map_file_defaultValue = {""} |
const std::string | m_MAP_MODE_map_context_defaultValue = {""} |
const std::string | m_clip_max_defaultValue = {"3.5"} |
const std::string | m_clip_min_defaultValue = {"0.1"} |
const std::string | m_GENERAL_period_defaultValue = {"0.02"} |
const std::string | m_CONSTANT_MODE_const_distance_defaultValue = {"1"} |
std::string | m_test = {"use_pattern"} |
std::string | m_localization_port = {"/fakeLaser/location:i"} |
std::string | m_localization_server = {"/localizationServer"} |
std::string | m_localization_client = {"/fakeLaser/localizationClient"} |
std::string | m_localization_device = {"localization2DClient"} |
std::string | m_MAP_MODE_map_file = {} |
std::string | m_MAP_MODE_map_context = {} |
double | m_clip_max = {3.5} |
double | m_clip_min = {0.1} |
double | m_GENERAL_period = {0.02} |
double | m_CONSTANT_MODE_const_distance = {1} |
Protected Types | |
enum | test_mode_t { NO_OBSTACLES = 0 , USE_PATTERN =1 , USE_MAPFILE =2 , USE_CONSTANT_VALUE =3 , USE_SQUARE_TRAP } |
Additional Inherited Members | |
Public Types inherited from yarp::dev::IRangefinder2D | |
enum | Device_status { DEVICE_OK_STANDBY = 0 , DEVICE_OK_IN_USE = 1 , DEVICE_GENERAL_ERROR = 2 , DEVICE_TIMEOUT = 3 } |
Protected Member Functions inherited from yarp::os::PeriodicThread | |
virtual void | beforeStart () |
Called just before a new thread starts. | |
virtual void | afterStart (bool success) |
Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). | |
Protected Member Functions inherited from yarp::dev::Lidar2DDeviceBase | |
virtual bool | updateLidarData () |
This utility method calls in sequence: grabDataFromHW(), updateTimestamp and applyLimitsOnLaserData(). | |
virtual bool | updateTimestamp () |
By default, it automatically updates the internal timestamp with the yarp time. | |
virtual bool | applyLimitsOnLaserData () |
Apply the limits on the internally stored lidar measurements. | |
Protected Member Functions inherited from yarp::dev::StubImplInteractionModeRaw | |
bool | NOT_YET_IMPLEMENTED (const char *func=0) |
Helper for printing error message, see below. | |
Protected Member Functions inherited from yarp::dev::ImplementPositionControl | |
bool | initialize (int size, const int *amap, const double *enc, const double *zos) |
Initialize the internal data and alloc memory. | |
bool | uninitialize () |
Clean up internal data and memory. | |
Protected Member Functions inherited from yarp::dev::ImplementVelocityControl | |
bool | initialize (int size, const int *amap, const double *enc, const double *zos) |
Initialize the internal data and alloc memory. | |
bool | uninitialize () |
Clean up internal data and memory. | |
Protected Member Functions inherited from yarp::dev::ImplementInteractionMode | |
bool | initialize (int size, const int *amap) |
Initialize the internal data and alloc memory, smaller version. | |
bool | initialize (int size, const int *amap, const double *enc, const double *zos) |
Initialize the internal data and alloc memory. | |
bool | uninitialize () |
Clean up internal data and memory. | |
Protected Member Functions inherited from yarp::dev::ImplementEncodersTimed | |
bool | initialize (int size, const int *amap, const double *enc, const double *zos) |
Initialize the internal data and alloc memory. | |
bool | uninitialize () |
Clean up internal data and memory. | |
Protected Member Functions inherited from yarp::dev::ImplementAxisInfo | |
bool | initialize (int size, const int *amap) |
Initialize the internal data and alloc memory. | |
bool | uninitialize () |
Clean up internal data and memory. | |
fakeLaserWithMotor
: fake sensor device driver for testing purposes and reference for IRangefinder2D devices.
Parameters required by this device are shown in class: FakeLaserWithMotor_ParamsParser
yarpdev –device fakeLaser –help yarpdev –device rangefinder2D_nws_yarp –subdevice fakeLaserWithMotor –period 0.01 –name /ikart/laser:o –test no_obstacles yarpdev –device rangefinder2D_nws_yarp –subdevice fakeLaserWithMotor –period 0.01 –name /ikart/laser:o –test use_pattern yarpdev –device rangefinder2D_nws_yarp –subdevice fakeLaserWithMotor –period 0.01 –name /ikart/laser:o –test use_mapfile –map_file mymap.map yarpdev –device rangefinder2D_nws_yarp –subdevice fakeLaserWithMotor –period 0.01 –name /ikart/laser:o –test use_mapfile –map_file mymap.map yarpdev –device rangefinder2D_nws_yarp –subdevice fakeLaserWithMotor –period 0.01 –name /ikart/laser:o –test use_mapfile –map_file mymap.map yarpdev –device rangefinder2D_nws_yarp –subdevice fakeLaserWithMotor –period 0.01 –name /ikart/laser:o –test use_mapfile –map_file mymap.map
Definition at line 50 of file FakeLaserWithMotor.h.
|
protected |
Enumerator | |
---|---|
NO_OBSTACLES | |
USE_PATTERN | |
USE_MAPFILE | |
USE_CONSTANT_VALUE | |
USE_SQUARE_TRAP |
Definition at line 70 of file FakeLaserWithMotor.h.
|
inline |
Definition at line 92 of file FakeLaserWithMotor.h.
|
inline |
Definition at line 115 of file FakeLaserWithMotor.h.
|
finaloverridevirtual |
This method should be implemented by the user, and contain the logic to grab data from the hardware.
Implements yarp::dev::Lidar2DDeviceBase.
Definition at line 66 of file FakeLaserWithMotor_laser.cpp.
Definition at line 324 of file FakeLaserWithMotor_motors.cpp.
Check if the current trajectory is terminated.
Non blocking.
flag | is a pointer to return value ("and" of all joints) |
Implements yarp::dev::IPositionControlRaw.
Definition at line 144 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Check if the current trajectory is terminated.
Non blocking.
joints | pointer to the array of joint numbers |
flag | true if the trajectory is terminated, false otherwise (a single value which is the 'and' of all joints') |
Implements yarp::dev::IPositionControlRaw.
Definition at line 497 of file FakeLaserWithMotor_motors.cpp.
Check if the current trajectory is terminated.
Non blocking.
j | is the axis number |
flag | is a pointer to return value |
Implements yarp::dev::IPositionControlRaw.
Definition at line 138 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 189 of file FakeLaserWithMotor.cpp.
bool FakeLaserWithMotor::dealloc | ( | ) |
Definition at line 342 of file FakeLaserWithMotor_motors.cpp.
Get the number of controlled axes.
This command asks the number of controlled axes for the current physical interface.
Implements yarp::dev::IEncodersRaw.
Definition at line 81 of file FakeLaserWithMotor_motors.cpp.
Implements yarp::dev::IAxisInfoRaw.
Definition at line 617 of file FakeLaserWithMotor_motors.cpp.
Implements yarp::dev::IControlModeRaw.
Definition at line 261 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Implements yarp::dev::IControlModeRaw.
Definition at line 278 of file FakeLaserWithMotor_motors.cpp.
Implements yarp::dev::IControlModeRaw.
Definition at line 268 of file FakeLaserWithMotor_motors.cpp.
Read the instantaneous acceleration of an axis.
j | axis number |
spds | pointer to the array that will contain the output |
Implements yarp::dev::IEncodersRaw.
Definition at line 414 of file FakeLaserWithMotor_motors.cpp.
Read the instantaneous acceleration of all axes.
accs | pointer to the array that will contain the output |
Implements yarp::dev::IEncodersRaw.
Definition at line 422 of file FakeLaserWithMotor_motors.cpp.
Read the value of an encoder.
j | encoder number |
v | pointer to storage for the return value |
Implements yarp::dev::IEncodersRaw.
Definition at line 376 of file FakeLaserWithMotor_motors.cpp.
Read the instantaneous speed of an axis.
j | axis number |
sp | pointer to storage for the output |
Implements yarp::dev::IEncodersRaw.
Definition at line 397 of file FakeLaserWithMotor_motors.cpp.
Read the instantaneous acceleration of an axis.
spds | pointer to storage for the output values |
Implements yarp::dev::IEncodersRaw.
Definition at line 404 of file FakeLaserWithMotor_motors.cpp.
Read the position of all axes.
encs | pointer to the array that will contain the output |
Implements yarp::dev::IEncodersRaw.
Definition at line 385 of file FakeLaserWithMotor_motors.cpp.
Read the instantaneous acceleration of all axes.
encs | pointer to the array that will contain the output |
stamps | pointer to the array that will contain individual timestamps |
Implements yarp::dev::IEncodersTimedRaw.
Definition at line 60 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Read the instantaneous acceleration of all axes.
j | axis index |
encs | encoder value |
stamp | corresponding timestamp |
Implements yarp::dev::IEncodersTimedRaw.
Definition at line 71 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Reimplemented from yarp::dev::IAxisInfoRaw.
Definition at line 631 of file FakeLaserWithMotor_motors.cpp.
Get reference acceleration for a joint.
Returns the acceleration used to generate the trajectory profile.
j | joint number |
acc | pointer to storage for the return value |
Implements yarp::dev::IPositionControlRaw.
Definition at line 233 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Get reference acceleration for a joint.
Returns the acceleration used to generate the trajectory profile.
joints | pointer to the array of joint numbers |
accs | pointer to the array that will store the acceleration values |
Implements yarp::dev::IPositionControlRaw.
Definition at line 452 of file FakeLaserWithMotor_motors.cpp.
Get reference acceleration of all joints.
These are the values used during the interpolation of the trajectory.
accs | pointer to the array that will store the acceleration values. |
Implements yarp::dev::IPositionControlRaw.
Definition at line 239 of file FakeLaserWithMotor_motors.cpp.
Get reference speed for a joint.
Returns the speed used to generate the trajectory profile.
j | joint number |
ref | pointer to storage for the return value |
Implements yarp::dev::IPositionControlRaw.
Definition at line 221 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Get reference speed of all joints.
These are the values used during the interpolation of the trajectory.
joints | pointer to the array of joint numbers |
spds | pointer to the array that will store the speed values. |
Implements yarp::dev::IPositionControlRaw.
Definition at line 442 of file FakeLaserWithMotor_motors.cpp.
Get reference speed of all joints.
These are the values used during the interpolation of the trajectory.
spds | pointer to the array that will store the speed values. |
Implements yarp::dev::IPositionControlRaw.
Definition at line 227 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Get the last reference speed set by velocityMove for a group of joints.
n_joint | how many joints this command is referring to |
joints | of joints controlled. The size of this array is n_joints |
vels | pointer to the array containing the requested values, one value for each joint. The size of the array is n_joints. |
Reimplemented from yarp::dev::IVelocityControlRaw.
Definition at line 606 of file FakeLaserWithMotor_motors.cpp.
Get the last reference speed set by velocityMove for all joints.
vels | pointer to the array containing the new speed values, one value for each joint |
Reimplemented from yarp::dev::IVelocityControlRaw.
Definition at line 596 of file FakeLaserWithMotor_motors.cpp.
Get the last reference speed set by velocityMove for single joint.
j | joint number |
vel | returns the requested reference. |
Reimplemented from yarp::dev::IVelocityControlRaw.
Definition at line 590 of file FakeLaserWithMotor_motors.cpp.
Get the last position reference for the specified axis.
This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition
ref | last reference sent using PositionMove functions |
Reimplemented from yarp::dev::IPositionControlRaw.
Definition at line 522 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Get the last position reference for the specified group of axes.
This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition
ref | last reference sent using PositionMove functions |
Reimplemented from yarp::dev::IPositionControlRaw.
Definition at line 546 of file FakeLaserWithMotor_motors.cpp.
Get the last position reference for all axes.
This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition
ref | last reference sent using PositionMove functions |
Reimplemented from yarp::dev::IPositionControlRaw.
Definition at line 537 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Open the DeviceDriver.
config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 32 of file FakeLaserWithMotor.cpp.
Set new reference point for all axes.
refs | array, new reference points. |
Implements yarp::dev::IPositionControlRaw.
Definition at line 102 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Set new reference point for a subset of joints.
joints | pointer to the array of joint numbers |
refs | pointer to the array specifies the new reference points |
Implements yarp::dev::IPositionControlRaw.
Definition at line 472 of file FakeLaserWithMotor_motors.cpp.
Set new reference point for a single axis.
j | joint number |
ref | specifies the new ref point |
Implements yarp::dev::IPositionControlRaw.
Definition at line 87 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Read this object from a network connection.
Override this for your particular class.
reader | an interface to the network connection for reading |
Implements yarp::os::PortReader.
Definition at line 238 of file FakeLaserWithMotor.cpp.
Set relative position, all joints.
deltas | pointer to the relative commands |
Implements yarp::dev::IPositionControlRaw.
Definition at line 127 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Set relative position for a subset of joints.
joints | pointer to the array of joint numbers |
deltas | pointer to the array of relative commands |
Implements yarp::dev::IPositionControlRaw.
Definition at line 487 of file FakeLaserWithMotor_motors.cpp.
Set relative position.
The command is relative to the current position of the axis.
j | joint axis number |
delta | relative command |
Implements yarp::dev::IPositionControlRaw.
Definition at line 112 of file FakeLaserWithMotor_motors.cpp.
Reset encoder, single joint.
Set the encoder value to zero
j | encoder number |
Implements yarp::dev::IEncodersRaw.
Definition at line 366 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Reset encoders.
Set the encoders value to zero
Implements yarp::dev::IEncodersRaw.
Definition at line 371 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Loop function.
This is the thread itself. The thread calls the run() function every <period> ms. At the end of each run, the thread will sleep the amounth of time required, taking into account the time spent inside the loop function. Example: requested period is 10ms, the run() function take 3ms to be executed, the thread will sleep for 7ms.
Note: after each run is completed, the thread will call a yield() in order to facilitate other threads to run.
Implements yarp::os::PeriodicThread.
Definition at line 209 of file FakeLaserWithMotor.cpp.
Implements yarp::dev::IControlModeRaw.
Definition at line 290 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Implements yarp::dev::IControlModeRaw.
Definition at line 304 of file FakeLaserWithMotor_motors.cpp.
Implements yarp::dev::IControlModeRaw.
Definition at line 314 of file FakeLaserWithMotor_motors.cpp.
set the device detection range.
Invalid setting will be discarded.
min | the minimum detection distance |
max | the maximum detection distance |
Implements yarp::dev::IRangefinder2D.
Definition at line 32 of file FakeLaserWithMotor_laser.cpp.
Set the value of the encoder for a given joint.
j | encoder number |
val | new value |
Implements yarp::dev::IEncodersRaw.
Definition at line 356 of file FakeLaserWithMotor_motors.cpp.
Set the value of all encoders.
vals | pointer to the new values |
Implements yarp::dev::IEncodersRaw.
Definition at line 361 of file FakeLaserWithMotor_motors.cpp.
get the angular step between two measurements (if available)
step | the angular step between two measurements |
Implements yarp::dev::IRangefinder2D.
Definition at line 50 of file FakeLaserWithMotor_laser.cpp.
Set reference acceleration for a joint.
This value is used during the trajectory generation.
j | joint number |
acc | acceleration value |
Implements yarp::dev::IPositionControlRaw.
Definition at line 178 of file FakeLaserWithMotor_motors.cpp.
Set reference acceleration on all joints.
This is the valure that is used during the generation of the trajectory.
accs | pointer to the array of acceleration values |
Implements yarp::dev::IPositionControlRaw.
Definition at line 199 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Set reference acceleration on all joints.
This is the valure that is used during the generation of the trajectory.
joints | pointer to the array of joint numbers |
accs | pointer to the array with acceleration values |
Implements yarp::dev::IPositionControlRaw.
Definition at line 432 of file FakeLaserWithMotor_motors.cpp.
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
j | joint number |
sp | speed value |
Implements yarp::dev::IPositionControlRaw.
Definition at line 158 of file FakeLaserWithMotor_motors.cpp.
Set reference speed on all joints.
These values are used during the interpolation of the trajectory.
spds | pointer to the array of speed values. |
Implements yarp::dev::IPositionControlRaw.
Definition at line 167 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Set reference speed on all joints.
These values are used during the interpolation of the trajectory.
joints | pointer to the array of joint numbers |
spds | pointer to the array with speed values. |
Implements yarp::dev::IPositionControlRaw.
Definition at line 512 of file FakeLaserWithMotor_motors.cpp.
set the scan angular range.
min | start angle of the scan |
max | end angle of the scan |
Implements yarp::dev::IRangefinder2D.
Definition at line 41 of file FakeLaserWithMotor_laser.cpp.
set the scan rate (scans per seconds)
rate | the scan rate |
Implements yarp::dev::IRangefinder2D.
Definition at line 58 of file FakeLaserWithMotor_laser.cpp.
|
overridevirtual |
Stop motion, multiple joints.
Implements yarp::dev::IPositionControlRaw.
Definition at line 250 of file FakeLaserWithMotor_motors.cpp.
Stop motion for subset of joints.
joints | pointer to the array of joint numbers |
Implements yarp::dev::IPositionControlRaw.
Definition at line 462 of file FakeLaserWithMotor_motors.cpp.
Stop motion, single joint.
j | joint number |
Implements yarp::dev::IPositionControlRaw.
Definition at line 245 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Initialization method.
The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the "start" method.
Reimplemented from yarp::os::PeriodicThread.
Definition at line 199 of file FakeLaserWithMotor.cpp.
|
overridevirtual |
Release method.
The thread executes this function once when it exits, after the last "run". This is a good place to release resources that were initialized in threadInit() (release memory, and device driver resources).
Reimplemented from yarp::os::PeriodicThread.
Definition at line 316 of file FakeLaserWithMotor.cpp.
Start motion at a given speed, multiple joints.
sp | pointer to the array containing the new speed values |
Implements yarp::dev::IVelocityControlRaw.
Definition at line 572 of file FakeLaserWithMotor_motors.cpp.
|
overridevirtual |
Start motion at a given speed for a subset of joints.
n_joint | how many joints this command is referring to |
joints | pointer to the array of joint numbers |
spds | pointer to the array containing the new speed values |
Implements yarp::dev::IVelocityControlRaw.
Definition at line 580 of file FakeLaserWithMotor_motors.cpp.
Start motion at a given speed, single joint.
j | joint number |
sp | speed value |
Implements yarp::dev::IVelocityControlRaw.
Definition at line 556 of file FakeLaserWithMotor_motors.cpp.
std::string* FakeLaserWithMotor::_axisName = nullptr |
Definition at line 152 of file FakeLaserWithMotor.h.
double* FakeLaserWithMotor::_command_speeds = nullptr |
Definition at line 158 of file FakeLaserWithMotor.h.
int* FakeLaserWithMotor::_controlModes = nullptr |
Definition at line 154 of file FakeLaserWithMotor.h.
double* FakeLaserWithMotor::_encoders = nullptr |
Definition at line 155 of file FakeLaserWithMotor.h.
yarp::dev::JointTypeEnum* FakeLaserWithMotor::_jointType = nullptr |
Definition at line 153 of file FakeLaserWithMotor.h.
double* FakeLaserWithMotor::_posCtrl_references = nullptr |
Definition at line 156 of file FakeLaserWithMotor.h.
double* FakeLaserWithMotor::_ref_accs = nullptr |
Definition at line 159 of file FakeLaserWithMotor.h.
double* FakeLaserWithMotor::_ref_speeds = nullptr |
Definition at line 157 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 87 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 86 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 75 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 78 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 74 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 85 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 83 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 81 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 82 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 89 of file FakeLaserWithMotor.h.
|
protected |
Definition at line 72 of file FakeLaserWithMotor.h.