YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

fakeLaserWithMotor : fake sensor device driver for testing purposes and reference for IRangefinder2D devices. More...

#include <fake/fakeLaserWithMotor/FakeLaserWithMotor.h>

+ Inheritance diagram for FakeLaserWithMotor:

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.
 
yarp::dev::ReturnValue setDistanceRange (double min, double max) override
 set the device detection range.
 
yarp::dev::ReturnValue setScanLimits (double min, double max) override
 set the scan angular range.
 
yarp::dev::ReturnValue setHorizontalResolution (double step) override
 get the angular step between two measurements (if available)
 
yarp::dev::ReturnValue setScanRate (double rate) override
 set the scan rate (scans per seconds)
 
bool alloc (int njoints)
 
bool dealloc ()
 
yarp::dev::ReturnValue resetEncoderRaw (int j) override
 Reset encoder, single joint.
 
yarp::dev::ReturnValue resetEncodersRaw () override
 Reset encoders.
 
yarp::dev::ReturnValue setEncoderRaw (int j, double val) override
 Set the value of the encoder for a given joint.
 
yarp::dev::ReturnValue setEncodersRaw (const double *vals) override
 Set the value of all encoders.
 
yarp::dev::ReturnValue getEncoderRaw (int j, double *v) override
 Read the value of an encoder.
 
yarp::dev::ReturnValue getEncodersRaw (double *encs) override
 Read the position of all axes.
 
yarp::dev::ReturnValue getEncoderSpeedRaw (int j, double *sp) override
 Read the instantaneous speed of an axis.
 
yarp::dev::ReturnValue getEncoderSpeedsRaw (double *spds) override
 Read the instantaneous acceleration of an axis.
 
yarp::dev::ReturnValue getEncoderAccelerationRaw (int j, double *spds) override
 Read the instantaneous acceleration of an axis.
 
yarp::dev::ReturnValue getEncoderAccelerationsRaw (double *accs) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncodersTimedRaw (double *encs, double *stamps) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncoderTimedRaw (int j, double *encs, double *stamp) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue positionMoveRaw (int j, double ref) override
 Set new reference point for a single axis.
 
yarp::dev::ReturnValue positionMoveRaw (const double *refs) override
 Set new reference point for all axes.
 
yarp::dev::ReturnValue relativeMoveRaw (int j, double delta) override
 Set relative position.
 
yarp::dev::ReturnValue relativeMoveRaw (const double *deltas) override
 Set relative position, all joints.
 
yarp::dev::ReturnValue checkMotionDoneRaw (bool &flag) override
 Check if the current trajectory all joints is terminated.
 
yarp::dev::ReturnValue checkMotionDoneRaw (int j, bool &flag) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue setTrajSpeedRaw (int j, double sp) override
 Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
 
yarp::dev::ReturnValue setTrajSpeedsRaw (const double *spds) override
 Set reference speed on all joints.
 
yarp::dev::ReturnValue setTrajAccelerationRaw (int j, double acc) override
 Set reference acceleration for a joint.
 
yarp::dev::ReturnValue setTrajAccelerationsRaw (const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajSpeedRaw (int j, double *ref) override
 Get reference speed for a joint.
 
yarp::dev::ReturnValue getTrajSpeedsRaw (double *spds) override
 Get reference speed of all joints.
 
yarp::dev::ReturnValue getTrajAccelerationRaw (int j, double *acc) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue getTrajAccelerationsRaw (double *accs) override
 Get reference acceleration of all joints.
 
yarp::dev::ReturnValue stopRaw (int j) override
 Stop motion, single joint.
 
yarp::dev::ReturnValue stopRaw () override
 Stop motion, multiple joints.
 
yarp::dev::ReturnValue positionMoveRaw (const int n_joint, const int *joints, const double *refs) override
 Set new reference point for a subset of joints.
 
yarp::dev::ReturnValue relativeMoveRaw (const int n_joint, const int *joints, const double *deltas) override
 Set relative position for a subset of joints.
 
yarp::dev::ReturnValue checkMotionDoneRaw (const std::vector< int > &joints, bool &flags) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue setTrajSpeedsRaw (const int n_joint, const int *joints, const double *spds) override
 Set reference speed on all joints.
 
yarp::dev::ReturnValue setTrajAccelerationsRaw (const int n_joint, const int *joints, const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajSpeedsRaw (const int n_joint, const int *joints, double *spds) override
 Get reference speed of all joints.
 
yarp::dev::ReturnValue getTrajAccelerationsRaw (const int n_joint, const int *joints, double *accs) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue stopRaw (const int n_joint, const int *joints) override
 Stop motion for subset of joints.
 
yarp::dev::ReturnValue getTargetPositionRaw (const int joint, double *ref) override
 Get the last position reference for the specified axis.
 
yarp::dev::ReturnValue getTargetPositionsRaw (double *refs) override
 Get the last position reference for all axes.
 
yarp::dev::ReturnValue getTargetPositionsRaw (const int n_joint, const int *joints, double *refs) override
 Get the last position reference for the specified group of axes.
 
yarp::dev::ReturnValue getAvailableControlModesRaw (int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail) override
 
yarp::dev::ReturnValue getControlModeRaw (int j, yarp::dev::ControlModeEnum &mode) override
 
yarp::dev::ReturnValue getControlModesRaw (std::vector< yarp::dev::ControlModeEnum > &mode) override
 
yarp::dev::ReturnValue getControlModesRaw (const std::vector< int > &j, std::vector< yarp::dev::ControlModeEnum > &mode) override
 
yarp::dev::ReturnValue setControlModeRaw (int j, yarp::dev::SelectableControlModeEnum mode) override
 
yarp::dev::ReturnValue setControlModesRaw (const std::vector< int > &j, const std::vector< yarp::dev::SelectableControlModeEnum > &mode) override
 
yarp::dev::ReturnValue setControlModesRaw (const std::vector< yarp::dev::SelectableControlModeEnum > &mode) override
 
yarp::dev::ReturnValue velocityMoveRaw (int j, double sp) override
 Start motion at a given speed, single joint.
 
yarp::dev::ReturnValue velocityMoveRaw (const double *sp) override
 Start motion at a given speed, multiple joints.
 
yarp::dev::ReturnValue velocityMoveRaw (const int n_joint, const int *joints, const double *spds) override
 Start motion at a given speed for a subset of joints.
 
yarp::dev::ReturnValue getTargetVelocityRaw (const int joint, double *ref) override
 Get the last reference speed set by velocityMove for single joint.
 
yarp::dev::ReturnValue getTargetVelocitiesRaw (double *refs) override
 Get the last reference speed set by velocityMove for all joints.
 
yarp::dev::ReturnValue getTargetVelocitiesRaw (const int n_joint, const int *joints, double *refs) override
 Get the last reference speed set by velocityMove for a group of joints.
 
yarp::dev::ReturnValue getAxisNameRaw (int axis, std::string &name) override
 
yarp::dev::ReturnValue 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 ()
 
yarp::dev::ReturnValue getRawData (yarp::sig::Vector &data, double *timestamp=nullptr) override
 Get the device measurements.
 
yarp::dev::ReturnValue getLaserMeasurement (std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override
 Get the device measurements.
 
yarp::dev::ReturnValue getDeviceStatus (Device_status &status) override
 get the device status
 
yarp::dev::ReturnValue getDeviceInfo (std::string &device_info) override
 get the device hardware characteristics
 
yarp::dev::ReturnValue getDistanceRange (double &min, double &max) override
 get the device detection range
 
yarp::dev::ReturnValue getScanLimits (double &min, double &max) override
 get the scan angular range.
 
yarp::dev::ReturnValue getHorizontalResolution (double &step) override
 get the angular step between two measurements.
 
yarp::dev::ReturnValue 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.
 
yarp::dev::ReturnValue getInteractionModeRaw (int axis, yarp::dev::InteractionModeEnum &mode) override
 Get the current interaction mode of the robot, values can be stiff or compliant.
 
yarp::dev::ReturnValue getInteractionModesRaw (const std::vector< int > &joints, std::vector< yarp::dev::InteractionModeEnum > &modes) override
 Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
 
yarp::dev::ReturnValue getInteractionModesRaw (std::vector< yarp::dev::InteractionModeEnum > &modes) override
 Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant.
 
yarp::dev::ReturnValue setInteractionModeRaw (int axis, yarp::dev::InteractionModeEnum mode) override
 Set the interaction mode of the robot, values can be stiff or compliant.
 
yarp::dev::ReturnValue setInteractionModesRaw (const std::vector< int > &joints, const std::vector< yarp::dev::InteractionModeEnum > &modes) override
 Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
 
yarp::dev::ReturnValue setInteractionModesRaw (const std::vector< 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.
 
yarp::dev::ReturnValue getAxes (size_t &axis) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue positionMove (int j, double ref) override
 Set new reference point for a single axis.
 
yarp::dev::ReturnValue positionMove (const int n_joint, const int *joints, const double *refs) override
 Set new reference point for a subset of joints.
 
yarp::dev::ReturnValue positionMove (const double *refs) override
 Set new reference point for all axes.
 
yarp::dev::ReturnValue relativeMove (int j, double delta) override
 Set relative position.
 
yarp::dev::ReturnValue relativeMove (const int n_joint, const int *joints, const double *deltas) override
 Set relative position for a subset of joints.
 
yarp::dev::ReturnValue relativeMove (const double *deltas) override
 Set relative position, all joints.
 
yarp::dev::ReturnValue checkMotionDone (bool &flag) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue checkMotionDone (const std::vector< int > &joints, bool &flags) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue checkMotionDone (int j, bool &flag) override
 Check if the current trajectory is terminated.
 
yarp::dev::ReturnValue setTrajSpeed (int j, double sp) override
 Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
 
yarp::dev::ReturnValue setTrajSpeeds (const int n_joint, const int *joints, const double *spds) override
 Set reference speed on all joints.
 
yarp::dev::ReturnValue setTrajSpeeds (const double *spds) override
 Set reference speed on all joints.
 
yarp::dev::ReturnValue setTrajAcceleration (int j, double acc) override
 Set reference acceleration for a joint.
 
yarp::dev::ReturnValue setTrajAccelerations (const int n_joint, const int *joints, const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue setTrajAccelerations (const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajSpeed (int j, double *ref) override
 Get reference speed for a joint.
 
yarp::dev::ReturnValue getTrajSpeeds (const int n_joint, const int *joints, double *spds) override
 Get reference speed of all joints.
 
yarp::dev::ReturnValue getTrajSpeeds (double *spds) override
 Get reference speed of all joints.
 
yarp::dev::ReturnValue getTrajAcceleration (int j, double *acc) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue getTrajAccelerations (const int n_joint, const int *joints, double *accs) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue getTrajAccelerations (double *accs) override
 Get reference acceleration of all joints.
 
yarp::dev::ReturnValue stop (int j) override
 Stop motion, single joint.
 
yarp::dev::ReturnValue stop (const int n_joint, const int *joints) override
 Stop motion for subset of joints.
 
yarp::dev::ReturnValue stop () override
 Stop motion, multiple joints.
 
yarp::dev::ReturnValue getTargetPosition (const int joint, double *ref) override
 Get the last position reference for the specified axis.
 
yarp::dev::ReturnValue getTargetPositions (double *refs) override
 Get the last position reference for all axes.
 
yarp::dev::ReturnValue 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.
 
yarp::dev::ReturnValue getAxes (size_t &axes) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue velocityMove (int j, double sp) override
 Start motion at a given speed, single joint.
 
yarp::dev::ReturnValue velocityMove (const double *sp) override
 Start motion at a given speed, multiple joints.
 
yarp::dev::ReturnValue setTrajAcceleration (int j, double acc) override
 Set reference acceleration for a joint.
 
yarp::dev::ReturnValue setTrajAccelerations (const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajAcceleration (int j, double *acc) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue getTrajAccelerations (double *accs) override
 Get reference acceleration of all joints.
 
yarp::dev::ReturnValue stop (int j) override
 Stop motion, single joint.
 
yarp::dev::ReturnValue stop () override
 Stop motion, multiple joints.
 
yarp::dev::ReturnValue velocityMove (const int n_joint, const int *joints, const double *spds) override
 Start motion at a given speed for a subset of joints.
 
yarp::dev::ReturnValue getTargetVelocity (const int joint, double *vel) override
 Get the last reference speed set by velocityMove for single joint.
 
yarp::dev::ReturnValue getTargetVelocities (double *vels) override
 Get the last reference speed set by velocityMove for all joints.
 
yarp::dev::ReturnValue getTargetVelocities (const int n_joint, const int *joints, double *vels) override
 Get the last reference speed set by velocityMove for a group of joints.
 
yarp::dev::ReturnValue setTrajAccelerations (const int n_joint, const int *joints, const double *accs) override
 Set reference acceleration for a subset of joints.
 
yarp::dev::ReturnValue getTrajAccelerations (const int n_joint, const int *joints, double *accs) override
 Get reference acceleration for a subset of joints.
 
yarp::dev::ReturnValue 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 ()
 
yarp::dev::ReturnValue getAvailableControlModes (int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail) override
 Return a list of available control mode for the given joint.
 
yarp::dev::ReturnValue getControlMode (int j, yarp::dev::ControlModeEnum &mode) override
 Get the current control mode.
 
yarp::dev::ReturnValue getControlModes (const std::vector< int > &joints, std::vector< yarp::dev::ControlModeEnum > &modes) override
 Get the current control mode for a subset of axes.
 
yarp::dev::ReturnValue getControlModes (std::vector< yarp::dev::ControlModeEnum > &modes) override
 Get the current control mode (multiple joints).
 
yarp::dev::ReturnValue setControlMode (int j, yarp::dev::SelectableControlModeEnum mode) override
 Set the current control mode.
 
yarp::dev::ReturnValue setControlModes (const std::vector< int > &joints, const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
 Set the current control mode for a subset of axes.
 
yarp::dev::ReturnValue setControlModes (const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
 Set the current control mode (multiple joints).
 
virtual yarp::dev::ReturnValue getControlMode (int j, yarp::dev::ControlModeEnum &mode)=0
 Get the current control mode.
 
virtual yarp::dev::ReturnValue getControlMode (int j, int *mode)
 
virtual yarp::dev::ReturnValue setControlMode (int j, yarp::dev::SelectableControlModeEnum mode)=0
 Set the current control mode.
 
virtual yarp::dev::ReturnValue setControlMode (const int j, const int mode)
 
- 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.
 
yarp::dev::ReturnValue getInteractionMode (int axis, yarp::dev::InteractionModeEnum &mode) override
 Get the current interaction mode of the robot, values can be stiff or compliant.
 
yarp::dev::ReturnValue getInteractionModes (const std::vector< int > &joints, std::vector< yarp::dev::InteractionModeEnum > &modes) override
 Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
 
yarp::dev::ReturnValue getInteractionModes (std::vector< yarp::dev::InteractionModeEnum > &modes) override
 Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant.
 
yarp::dev::ReturnValue setInteractionMode (int axis, yarp::dev::InteractionModeEnum mode) override
 Set the interaction mode of the robot, values can be stiff or compliant.
 
yarp::dev::ReturnValue setInteractionModes (const std::vector< int > &joints, const std::vector< yarp::dev::InteractionModeEnum > &modes) override
 Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
 
yarp::dev::ReturnValue setInteractionModes (const std::vector< 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 ()
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue resetEncoder (int j) override
 Reset encoder, single joint.
 
yarp::dev::ReturnValue resetEncoders () override
 Reset encoders.
 
yarp::dev::ReturnValue setEncoder (int j, double val) override
 Set the value of the encoder for a given joint.
 
yarp::dev::ReturnValue setEncoders (const double *vals) override
 Set the value of all encoders.
 
yarp::dev::ReturnValue getEncoder (int j, double *v) override
 Read the value of an encoder.
 
yarp::dev::ReturnValue getEncodersTimed (double *encs, double *time) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncoderTimed (int j, double *v, double *t) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncoders (double *encs) override
 Read the position of all axes.
 
yarp::dev::ReturnValue getEncoderSpeed (int j, double *spds) override
 Read the istantaneous speed of an axis.
 
yarp::dev::ReturnValue getEncoderSpeeds (double *spds) override
 Read the instantaneous speed of all axes.
 
yarp::dev::ReturnValue getEncoderAcceleration (int j, double *spds) override
 Read the instantaneous acceleration of an axis.
 
yarp::dev::ReturnValue 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 ()
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue getAxisName (int axis, std::string &name) override
 
yarp::dev::ReturnValue 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.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of 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
 
std::vector< yarp::dev::SelectableControlModeEnum > * _availableControlModes = 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 = {}
 
std::string m_provided_configuration
 
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
}
 

Protected Attributes

test_mode_t m_test_mode
 
yarp::dev::Nav2D::MapGrid2D m_originally_loaded_map
 
yarp::dev::Nav2D::MapGrid2D m_map
 
size_t m_njoints =3
 
double m_robot_loc_x =0
 
double m_robot_loc_y =0
 
double m_robot_loc_t =0
 
std::random_device * m_rd
 
std::mt19937 * m_gen
 
std::uniform_real_distribution * m_dis
 
yarp::os::Port m_rpcPort
 
- Protected Attributes inherited from yarp::dev::Lidar2DDeviceBase
yarp::sig::Vector m_laser_data
 
yarp::os::Stamp m_timestamp
 
yarp::dev::IRangefinder2D::Device_status m_device_status
 
std::mutex m_mutex
 
std::string m_info
 
double m_scan_rate
 
size_t m_sensorsNum
 
double m_min_angle
 
double m_max_angle
 
double m_min_distance
 
double m_max_distance
 
double m_resolution
 
bool m_clip_max_enable
 
bool m_clip_min_enable
 
bool m_do_not_clip_and_allow_infinity_enable
 
std::vector< Range_t > m_range_skip_vector
 
- Protected Attributes inherited from yarp::dev::ImplementPositionControl
IPositionControlRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::mutex m_imp_mutex
 
- Protected Attributes inherited from yarp::dev::ImplementVelocityControl
IVelocityControlRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::mutex m_imp_mutex
 
- Protected Attributes inherited from yarp::dev::ImplementInteractionMode
yarp::dev::IInteractionModeRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::mutex m_imp_mutex
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::vector< yarp::dev::InteractionModeEnum > m_buffer_enums
 
- Protected Attributes inherited from yarp::dev::ImplementEncodersTimed
IEncodersTimedRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::vector< double > m_buffer_doubles2
 
std::mutex m_imp_mutex
 
- Protected Attributes inherited from yarp::dev::ImplementAxisInfo
IAxisInfoRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::vector< double > m_buffer_doubles2
 
std::mutex m_imp_mutex
 

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::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.
 

Detailed Description

fakeLaserWithMotor : fake sensor device driver for testing purposes and reference for IRangefinder2D devices.

Parameters required by this device are shown in class: FakeLaserWithMotor_ParamsParser

examples:

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.

Member Enumeration Documentation

◆ test_mode_t

Enumerator
NO_OBSTACLES 
USE_PATTERN 
USE_MAPFILE 
USE_CONSTANT_VALUE 
USE_SQUARE_TRAP 

Definition at line 70 of file FakeLaserWithMotor.h.

Constructor & Destructor Documentation

◆ FakeLaserWithMotor()

FakeLaserWithMotor::FakeLaserWithMotor ( double  period = 0.02)
inline

Definition at line 92 of file FakeLaserWithMotor.h.

◆ ~FakeLaserWithMotor()

FakeLaserWithMotor::~FakeLaserWithMotor ( )
inline

Definition at line 115 of file FakeLaserWithMotor.h.

Member Function Documentation

◆ acquireDataFromHW()

bool FakeLaserWithMotor::acquireDataFromHW ( )
finaloverridevirtual

This method should be implemented by the user, and contain the logic to grab data from the hardware.

Returns
true/false if the method is successful.

Implements yarp::dev::Lidar2DDeviceBase.

Definition at line 66 of file FakeLaserWithMotor_laser.cpp.

◆ alloc()

bool FakeLaserWithMotor::alloc ( int  njoints)

Definition at line 331 of file FakeLaserWithMotor_motors.cpp.

◆ checkMotionDoneRaw() [1/3]

ReturnValue FakeLaserWithMotor::checkMotionDoneRaw ( bool &  flag)
overridevirtual

Check if the current trajectory all joints is terminated.

Non blocking.

Parameters
flagthe return value ("and" of all joints)
Returns
true/false on network communication (the value you actually want is stored in flag)

Implements yarp::dev::IPositionControlRaw.

Definition at line 144 of file FakeLaserWithMotor_motors.cpp.

◆ checkMotionDoneRaw() [2/3]

ReturnValue FakeLaserWithMotor::checkMotionDoneRaw ( const std::vector< int > &  joints,
bool &  flag 
)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
jointsthe array of joint numbers
flagtrue if the trajectory is terminated, false otherwise (a single value which is the 'and' of all joints')
Returns
true/false if network communication went well.

Implements yarp::dev::IPositionControlRaw.

Definition at line 520 of file FakeLaserWithMotor_motors.cpp.

◆ checkMotionDoneRaw() [3/3]

ReturnValue FakeLaserWithMotor::checkMotionDoneRaw ( int  j,
bool &  flag 
)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
jis the axis number
flagis a pointer to return value
Returns
true/false on network communication (the value you actually want is stored in flag)

Implements yarp::dev::IPositionControlRaw.

Definition at line 138 of file FakeLaserWithMotor_motors.cpp.

◆ close()

bool FakeLaserWithMotor::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 189 of file FakeLaserWithMotor.cpp.

◆ dealloc()

bool FakeLaserWithMotor::dealloc ( )

Definition at line 364 of file FakeLaserWithMotor_motors.cpp.

◆ getAvailableControlModesRaw()

ReturnValue FakeLaserWithMotor::getAvailableControlModesRaw ( int  j,
std::vector< yarp::dev::SelectableControlModeEnum > &  avail 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 261 of file FakeLaserWithMotor_motors.cpp.

◆ getAxes()

ReturnValue FakeLaserWithMotor::getAxes ( size_t &  ax)
overridevirtual

Get the number of controlled axes.

This command asks the number of controlled axes for the current physical interface.

Returns
the number of controlled axes.

Implements yarp::dev::IEncodersRaw.

Definition at line 81 of file FakeLaserWithMotor_motors.cpp.

◆ getAxisNameRaw()

ReturnValue FakeLaserWithMotor::getAxisNameRaw ( int  axis,
std::string &  name 
)
overridevirtual

Implements yarp::dev::IAxisInfoRaw.

Definition at line 640 of file FakeLaserWithMotor_motors.cpp.

◆ getControlModeRaw()

ReturnValue FakeLaserWithMotor::getControlModeRaw ( int  j,
yarp::dev::ControlModeEnum &  mode 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 268 of file FakeLaserWithMotor_motors.cpp.

◆ getControlModesRaw() [1/2]

ReturnValue FakeLaserWithMotor::getControlModesRaw ( const std::vector< int > &  j,
std::vector< yarp::dev::ControlModeEnum > &  mode 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 285 of file FakeLaserWithMotor_motors.cpp.

◆ getControlModesRaw() [2/2]

ReturnValue FakeLaserWithMotor::getControlModesRaw ( std::vector< yarp::dev::ControlModeEnum > &  mode)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 275 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderAccelerationRaw()

ReturnValue FakeLaserWithMotor::getEncoderAccelerationRaw ( int  j,
double *  spds 
)
overridevirtual

Read the instantaneous acceleration of an axis.

Parameters
jaxis number
spdspointer to the array that will contain the output

Implements yarp::dev::IEncodersRaw.

Definition at line 437 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderAccelerationsRaw()

ReturnValue FakeLaserWithMotor::getEncoderAccelerationsRaw ( double *  accs)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
accspointer to the array that will contain the output
Returns
true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersRaw.

Definition at line 445 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderRaw()

ReturnValue FakeLaserWithMotor::getEncoderRaw ( int  j,
double *  v 
)
overridevirtual

Read the value of an encoder.

Parameters
jencoder number
vpointer to storage for the return value
Returns
true/false, upon success/failure (you knew it, uh?)

Implements yarp::dev::IEncodersRaw.

Definition at line 399 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderSpeedRaw()

ReturnValue FakeLaserWithMotor::getEncoderSpeedRaw ( int  j,
double *  sp 
)
overridevirtual

Read the instantaneous speed of an axis.

Parameters
jaxis number
sppointer to storage for the output
Returns
true if successful, false ... otherwise.

Implements yarp::dev::IEncodersRaw.

Definition at line 420 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderSpeedsRaw()

ReturnValue FakeLaserWithMotor::getEncoderSpeedsRaw ( double *  spds)
overridevirtual

Read the instantaneous acceleration of an axis.

Parameters
spdspointer to storage for the output values
Returns
guess what? (true/false on success or failure).

Implements yarp::dev::IEncodersRaw.

Definition at line 427 of file FakeLaserWithMotor_motors.cpp.

◆ getEncodersRaw()

ReturnValue FakeLaserWithMotor::getEncodersRaw ( double *  encs)
overridevirtual

Read the position of all axes.

Parameters
encspointer to the array that will contain the output
Returns
true/false on success/failure

Implements yarp::dev::IEncodersRaw.

Definition at line 408 of file FakeLaserWithMotor_motors.cpp.

◆ getEncodersTimedRaw()

ReturnValue FakeLaserWithMotor::getEncodersTimedRaw ( double *  encs,
double *  stamps 
)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
encspointer to the array that will contain the output
stampspointer to the array that will contain individual timestamps
Returns
return true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersTimedRaw.

Definition at line 60 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderTimedRaw()

ReturnValue FakeLaserWithMotor::getEncoderTimedRaw ( int  j,
double *  encs,
double *  stamp 
)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
jaxis index
encsencoder value
stampcorresponding timestamp
Returns
true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersTimedRaw.

Definition at line 71 of file FakeLaserWithMotor_motors.cpp.

◆ getJointTypeRaw()

ReturnValue FakeLaserWithMotor::getJointTypeRaw ( int  axis,
yarp::dev::JointTypeEnum &  type 
)
overridevirtual

Reimplemented from yarp::dev::IAxisInfoRaw.

Definition at line 646 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetPositionRaw()

ReturnValue FakeLaserWithMotor::getTargetPositionRaw ( const int  joint,
double *  ref 
)
overridevirtual

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

Parameters
reflast reference sent using PositionMove functions
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 545 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetPositionsRaw() [1/2]

ReturnValue FakeLaserWithMotor::getTargetPositionsRaw ( const int  n_joint,
const int *  joints,
double *  refs 
)
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

Parameters
reflast reference sent using PositionMove functions
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 569 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetPositionsRaw() [2/2]

ReturnValue FakeLaserWithMotor::getTargetPositionsRaw ( double *  refs)
overridevirtual

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

Parameters
reflast reference sent using PositionMove functions
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 560 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetVelocitiesRaw() [1/2]

ReturnValue FakeLaserWithMotor::getTargetVelocitiesRaw ( const int  n_joint,
const int *  joints,
double *  vels 
)
overridevirtual

Get the last reference speed set by velocityMove for a group of joints.

Parameters
n_jointhow many joints this command is referring to
jointsof joints controlled. The size of this array is n_joints
velspointer to the array containing the requested values, one value for each joint. The size of the array is n_joints.
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControlRaw.

Definition at line 629 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetVelocitiesRaw() [2/2]

ReturnValue FakeLaserWithMotor::getTargetVelocitiesRaw ( double *  vels)
overridevirtual

Get the last reference speed set by velocityMove for all joints.

Parameters
velspointer to the array containing the new speed values, one value for each joint
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControlRaw.

Definition at line 619 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetVelocityRaw()

ReturnValue FakeLaserWithMotor::getTargetVelocityRaw ( const int  joint,
double *  vel 
)
overridevirtual

Get the last reference speed set by velocityMove for single joint.

Parameters
jjoint number
velreturns the requested reference.
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControlRaw.

Definition at line 613 of file FakeLaserWithMotor_motors.cpp.

◆ getTrajAccelerationRaw()

ReturnValue FakeLaserWithMotor::getTrajAccelerationRaw ( int  j,
double *  acc 
)
overridevirtual

Get reference acceleration for a joint.

Returns the acceleration used to generate the trajectory profile.

Parameters
jjoint number
accpointer to storage for the return value
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 233 of file FakeLaserWithMotor_motors.cpp.

◆ getTrajAccelerationsRaw() [1/2]

ReturnValue FakeLaserWithMotor::getTrajAccelerationsRaw ( const int  n_joint,
const int *  joints,
double *  accs 
)
overridevirtual

Get reference acceleration for a joint.

Returns the acceleration used to generate the trajectory profile.

Parameters
jointspointer to the array of joint numbers
accspointer to the array that will store the acceleration values
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 475 of file FakeLaserWithMotor_motors.cpp.

◆ getTrajAccelerationsRaw() [2/2]

ReturnValue FakeLaserWithMotor::getTrajAccelerationsRaw ( double *  accs)
overridevirtual

Get reference acceleration of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
accspointer to the array that will store the acceleration values.
Returns
true/false on success or failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 239 of file FakeLaserWithMotor_motors.cpp.

◆ getTrajSpeedRaw()

ReturnValue FakeLaserWithMotor::getTrajSpeedRaw ( int  j,
double *  ref 
)
overridevirtual

Get reference speed for a joint.

Returns the speed used to generate the trajectory profile.

Parameters
jjoint number
refpointer to storage for the return value
Returns
true/false on success or failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 221 of file FakeLaserWithMotor_motors.cpp.

◆ getTrajSpeedsRaw() [1/2]

ReturnValue FakeLaserWithMotor::getTrajSpeedsRaw ( const int  n_joint,
const int *  joints,
double *  spds 
)
overridevirtual

Get reference speed of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
jointspointer to the array of joint numbers
spdspointer to the array that will store the speed values.
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 465 of file FakeLaserWithMotor_motors.cpp.

◆ getTrajSpeedsRaw() [2/2]

ReturnValue FakeLaserWithMotor::getTrajSpeedsRaw ( double *  spds)
overridevirtual

Get reference speed of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
spdspointer to the array that will store the speed values.

Implements yarp::dev::IPositionControlRaw.

Definition at line 227 of file FakeLaserWithMotor_motors.cpp.

◆ open()

bool FakeLaserWithMotor::open ( yarp::os::Searchable &  config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. 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).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 32 of file FakeLaserWithMotor.cpp.

◆ positionMoveRaw() [1/3]

ReturnValue FakeLaserWithMotor::positionMoveRaw ( const double *  refs)
overridevirtual

Set new reference point for all axes.

Parameters
refsarray, new reference points.
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 102 of file FakeLaserWithMotor_motors.cpp.

◆ positionMoveRaw() [2/3]

ReturnValue FakeLaserWithMotor::positionMoveRaw ( const int  n_joint,
const int *  joints,
const double *  refs 
)
overridevirtual

Set new reference point for a subset of joints.

Parameters
jointspointer to the array of joint numbers
refspointer to the array specifies the new reference points
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 495 of file FakeLaserWithMotor_motors.cpp.

◆ positionMoveRaw() [3/3]

yarp::dev::ReturnValue FakeLaserWithMotor::positionMoveRaw ( int  j,
double  ref 
)
overridevirtual

Set new reference point for a single axis.

Parameters
jjoint number
refspecifies the new ref point
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 87 of file FakeLaserWithMotor_motors.cpp.

◆ read()

bool FakeLaserWithMotor::read ( yarp::os::ConnectionReader &  reader)
overridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Implements yarp::os::PortReader.

Definition at line 236 of file FakeLaserWithMotor.cpp.

◆ relativeMoveRaw() [1/3]

ReturnValue FakeLaserWithMotor::relativeMoveRaw ( const double *  deltas)
overridevirtual

Set relative position, all joints.

Parameters
deltaspointer to the relative commands
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 127 of file FakeLaserWithMotor_motors.cpp.

◆ relativeMoveRaw() [2/3]

ReturnValue FakeLaserWithMotor::relativeMoveRaw ( const int  n_joint,
const int *  joints,
const double *  deltas 
)
overridevirtual

Set relative position for a subset of joints.

Parameters
jointspointer to the array of joint numbers
deltaspointer to the array of relative commands
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 510 of file FakeLaserWithMotor_motors.cpp.

◆ relativeMoveRaw() [3/3]

ReturnValue FakeLaserWithMotor::relativeMoveRaw ( int  j,
double  delta 
)
overridevirtual

Set relative position.

The command is relative to the current position of the axis.

Parameters
jjoint axis number
deltarelative command
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 112 of file FakeLaserWithMotor_motors.cpp.

◆ resetEncoderRaw()

ReturnValue FakeLaserWithMotor::resetEncoderRaw ( int  j)
overridevirtual

Reset encoder, single joint.

Set the encoder value to zero

Parameters
jencoder number
Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 389 of file FakeLaserWithMotor_motors.cpp.

◆ resetEncodersRaw()

ReturnValue FakeLaserWithMotor::resetEncodersRaw ( )
overridevirtual

Reset encoders.

Set the encoders value to zero

Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 394 of file FakeLaserWithMotor_motors.cpp.

◆ run()

void FakeLaserWithMotor::run ( )
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.

◆ setControlModeRaw()

ReturnValue FakeLaserWithMotor::setControlModeRaw ( int  j,
yarp::dev::SelectableControlModeEnum  mode 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 297 of file FakeLaserWithMotor_motors.cpp.

◆ setControlModesRaw() [1/2]

ReturnValue FakeLaserWithMotor::setControlModesRaw ( const std::vector< int > &  j,
const std::vector< yarp::dev::SelectableControlModeEnum > &  mode 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 311 of file FakeLaserWithMotor_motors.cpp.

◆ setControlModesRaw() [2/2]

ReturnValue FakeLaserWithMotor::setControlModesRaw ( const std::vector< yarp::dev::SelectableControlModeEnum > &  mode)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 321 of file FakeLaserWithMotor_motors.cpp.

◆ setDistanceRange()

ReturnValue FakeLaserWithMotor::setDistanceRange ( double  min,
double  max 
)
overridevirtual

set the device detection range.

Invalid setting will be discarded.

Parameters
minthe minimum detection distance
maxthe maximum detection distance
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 32 of file FakeLaserWithMotor_laser.cpp.

◆ setEncoderRaw()

ReturnValue FakeLaserWithMotor::setEncoderRaw ( int  j,
double  val 
)
overridevirtual

Set the value of the encoder for a given joint.

Parameters
jencoder number
valnew value
Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 379 of file FakeLaserWithMotor_motors.cpp.

◆ setEncodersRaw()

ReturnValue FakeLaserWithMotor::setEncodersRaw ( const double *  vals)
overridevirtual

Set the value of all encoders.

Parameters
valspointer to the new values
Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 384 of file FakeLaserWithMotor_motors.cpp.

◆ setHorizontalResolution()

ReturnValue FakeLaserWithMotor::setHorizontalResolution ( double  step)
overridevirtual

get the angular step between two measurements (if available)

Parameters
stepthe angular step between two measurements
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 50 of file FakeLaserWithMotor_laser.cpp.

◆ setScanLimits()

ReturnValue FakeLaserWithMotor::setScanLimits ( double  min,
double  max 
)
overridevirtual

set the scan angular range.

Parameters
minstart angle of the scan
maxend angle of the scan
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 41 of file FakeLaserWithMotor_laser.cpp.

◆ setScanRate()

ReturnValue FakeLaserWithMotor::setScanRate ( double  rate)
overridevirtual

set the scan rate (scans per seconds)

Parameters
ratethe scan rate
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 58 of file FakeLaserWithMotor_laser.cpp.

◆ setTrajAccelerationRaw()

ReturnValue FakeLaserWithMotor::setTrajAccelerationRaw ( int  j,
double  acc 
)
overridevirtual

Set reference acceleration for a joint.

This value is used during the trajectory generation.

Parameters
jjoint number
accacceleration value
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 178 of file FakeLaserWithMotor_motors.cpp.

◆ setTrajAccelerationsRaw() [1/2]

ReturnValue FakeLaserWithMotor::setTrajAccelerationsRaw ( const double *  accs)
overridevirtual

Set reference acceleration on all joints.

This is the value that is used during the generation of the trajectory.

Parameters
accspointer to the array of acceleration values
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 199 of file FakeLaserWithMotor_motors.cpp.

◆ setTrajAccelerationsRaw() [2/2]

ReturnValue FakeLaserWithMotor::setTrajAccelerationsRaw ( const int  n_joint,
const int *  joints,
const double *  accs 
)
overridevirtual

Set reference acceleration on all joints.

This is the value that is used during the generation of the trajectory.

Parameters
jointspointer to the array of joint numbers
accspointer to the array with acceleration values
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 455 of file FakeLaserWithMotor_motors.cpp.

◆ setTrajSpeedRaw()

ReturnValue FakeLaserWithMotor::setTrajSpeedRaw ( int  j,
double  sp 
)
overridevirtual

Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.

Parameters
jjoint number
spspeed value
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 158 of file FakeLaserWithMotor_motors.cpp.

◆ setTrajSpeedsRaw() [1/2]

ReturnValue FakeLaserWithMotor::setTrajSpeedsRaw ( const double *  spds)
overridevirtual

Set reference speed on all joints.

These values are used during the interpolation of the trajectory.

Parameters
spdspointer to the array of speed values.
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 167 of file FakeLaserWithMotor_motors.cpp.

◆ setTrajSpeedsRaw() [2/2]

ReturnValue FakeLaserWithMotor::setTrajSpeedsRaw ( const int  n_joint,
const int *  joints,
const double *  spds 
)
overridevirtual

Set reference speed on all joints.

These values are used during the interpolation of the trajectory.

Parameters
jointspointer to the array of joint numbers
spdspointer to the array with speed values.
Returns
true/false upon success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 535 of file FakeLaserWithMotor_motors.cpp.

◆ stopRaw() [1/3]

ReturnValue FakeLaserWithMotor::stopRaw ( )
overridevirtual

Stop motion, multiple joints.

Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 250 of file FakeLaserWithMotor_motors.cpp.

◆ stopRaw() [2/3]

ReturnValue FakeLaserWithMotor::stopRaw ( const int  n_joint,
const int *  joints 
)
overridevirtual

Stop motion for subset of joints.

Parameters
jointspointer to the array of joint numbers
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 485 of file FakeLaserWithMotor_motors.cpp.

◆ stopRaw() [3/3]

ReturnValue FakeLaserWithMotor::stopRaw ( int  j)
overridevirtual

Stop motion, single joint.

Parameters
jjoint number
Returns
true/false on success/failure

Implements yarp::dev::IPositionControlRaw.

Definition at line 245 of file FakeLaserWithMotor_motors.cpp.

◆ threadInit()

bool FakeLaserWithMotor::threadInit ( )
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.

◆ threadRelease()

void FakeLaserWithMotor::threadRelease ( )
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 314 of file FakeLaserWithMotor.cpp.

◆ velocityMoveRaw() [1/3]

ReturnValue FakeLaserWithMotor::velocityMoveRaw ( const double *  sp)
overridevirtual

Start motion at a given speed, multiple joints.

Parameters
sppointer to the array containing the new speed values
Returns
true/false upon success/failure

Implements yarp::dev::IVelocityControlRaw.

Definition at line 595 of file FakeLaserWithMotor_motors.cpp.

◆ velocityMoveRaw() [2/3]

ReturnValue FakeLaserWithMotor::velocityMoveRaw ( const int  n_joint,
const int *  joints,
const double *  spds 
)
overridevirtual

Start motion at a given speed for a subset of joints.

Parameters
n_jointhow many joints this command is referring to
jointspointer to the array of joint numbers
spdspointer to the array containing the new speed values
Returns
true/false upon success/failure

Implements yarp::dev::IVelocityControlRaw.

Definition at line 603 of file FakeLaserWithMotor_motors.cpp.

◆ velocityMoveRaw() [3/3]

ReturnValue FakeLaserWithMotor::velocityMoveRaw ( int  j,
double  sp 
)
overridevirtual

Start motion at a given speed, single joint.

Parameters
jjoint number
spspeed value
Returns
bool/false upon success/failure

Implements yarp::dev::IVelocityControlRaw.

Definition at line 579 of file FakeLaserWithMotor_motors.cpp.

Member Data Documentation

◆ _availableControlModes

std::vector<yarp::dev::SelectableControlModeEnum>* FakeLaserWithMotor::_availableControlModes = nullptr

Definition at line 160 of file FakeLaserWithMotor.h.

◆ _axisName

std::string* FakeLaserWithMotor::_axisName = nullptr

Definition at line 152 of file FakeLaserWithMotor.h.

◆ _command_speeds

double* FakeLaserWithMotor::_command_speeds = nullptr

Definition at line 158 of file FakeLaserWithMotor.h.

◆ _controlModes

int* FakeLaserWithMotor::_controlModes = nullptr

Definition at line 154 of file FakeLaserWithMotor.h.

◆ _encoders

double* FakeLaserWithMotor::_encoders = nullptr

Definition at line 155 of file FakeLaserWithMotor.h.

◆ _jointType

yarp::dev::JointTypeEnum* FakeLaserWithMotor::_jointType = nullptr

Definition at line 153 of file FakeLaserWithMotor.h.

◆ _posCtrl_references

double* FakeLaserWithMotor::_posCtrl_references = nullptr

Definition at line 156 of file FakeLaserWithMotor.h.

◆ _ref_accs

double* FakeLaserWithMotor::_ref_accs = nullptr

Definition at line 159 of file FakeLaserWithMotor.h.

◆ _ref_speeds

double* FakeLaserWithMotor::_ref_speeds = nullptr

Definition at line 157 of file FakeLaserWithMotor.h.

◆ m_dis

std::uniform_real_distribution* FakeLaserWithMotor::m_dis
protected

Definition at line 87 of file FakeLaserWithMotor.h.

◆ m_gen

std::mt19937* FakeLaserWithMotor::m_gen
protected

Definition at line 86 of file FakeLaserWithMotor.h.

◆ m_map

yarp::dev::Nav2D::MapGrid2D FakeLaserWithMotor::m_map
protected

Definition at line 75 of file FakeLaserWithMotor.h.

◆ m_njoints

size_t FakeLaserWithMotor::m_njoints =3
protected

Definition at line 78 of file FakeLaserWithMotor.h.

◆ m_originally_loaded_map

yarp::dev::Nav2D::MapGrid2D FakeLaserWithMotor::m_originally_loaded_map
protected

Definition at line 74 of file FakeLaserWithMotor.h.

◆ m_rd

std::random_device* FakeLaserWithMotor::m_rd
protected

Definition at line 85 of file FakeLaserWithMotor.h.

◆ m_robot_loc_t

double FakeLaserWithMotor::m_robot_loc_t =0
protected

Definition at line 83 of file FakeLaserWithMotor.h.

◆ m_robot_loc_x

double FakeLaserWithMotor::m_robot_loc_x =0
protected

Definition at line 81 of file FakeLaserWithMotor.h.

◆ m_robot_loc_y

double FakeLaserWithMotor::m_robot_loc_y =0
protected

Definition at line 82 of file FakeLaserWithMotor.h.

◆ m_rpcPort

yarp::os::Port FakeLaserWithMotor::m_rpcPort
protected

Definition at line 89 of file FakeLaserWithMotor.h.

◆ m_test_mode

test_mode_t FakeLaserWithMotor::m_test_mode
protected

Definition at line 72 of file FakeLaserWithMotor.h.


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