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.
 
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
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (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 DeviceDrivergetImplementation ()
 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
}
 

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_tm_range_skip_vector
 
- Protected Attributes inherited from yarp::dev::ImplementPositionControl
IPositionControlRawiPosition
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< bool > * boolBuffManager
 
- Protected Attributes inherited from yarp::dev::ImplementVelocityControl
IVelocityControlRawiVelocity
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
 
- Protected Attributes inherited from yarp::dev::ImplementInteractionMode
yarp::dev::IInteractionModeRawiInteraction
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::InteractionModeEnum > * imodeBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
 
- Protected Attributes inherited from yarp::dev::ImplementEncodersTimed
IEncodersTimedRawiEncoders
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< double > * buffManager
 
- Protected Attributes inherited from yarp::dev::ImplementAxisInfo
IAxisInfoRawiinfo
 
void * helper
 
double * temp1
 
double * temp2
 

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.
 

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 324 of file FakeLaserWithMotor_motors.cpp.

◆ checkMotionDoneRaw() [1/3]

bool FakeLaserWithMotor::checkMotionDoneRaw ( bool flag)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
flagis a pointer to return value ("and" of all joints)
Returns
true/false on network communication (value you actually want is stored in *flag)

Implements yarp::dev::IPositionControlRaw.

Definition at line 144 of file FakeLaserWithMotor_motors.cpp.

◆ checkMotionDoneRaw() [2/3]

bool FakeLaserWithMotor::checkMotionDoneRaw ( const int  n_joint,
const int joints,
bool flags 
)
overridevirtual

Check if the current trajectory is terminated.

Non blocking.

Parameters
jointspointer to the 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 497 of file FakeLaserWithMotor_motors.cpp.

◆ checkMotionDoneRaw() [3/3]

bool 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 (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 342 of file FakeLaserWithMotor_motors.cpp.

◆ getAxes()

bool FakeLaserWithMotor::getAxes ( int 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()

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

Implements yarp::dev::IAxisInfoRaw.

Definition at line 617 of file FakeLaserWithMotor_motors.cpp.

◆ getControlModeRaw()

bool FakeLaserWithMotor::getControlModeRaw ( int  j,
int v 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 261 of file FakeLaserWithMotor_motors.cpp.

◆ getControlModesRaw() [1/2]

bool FakeLaserWithMotor::getControlModesRaw ( const int  n_joint,
const int joints,
int modes 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 278 of file FakeLaserWithMotor_motors.cpp.

◆ getControlModesRaw() [2/2]

bool FakeLaserWithMotor::getControlModesRaw ( int v)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 268 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderAccelerationRaw()

bool 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 414 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderAccelerationsRaw()

bool 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 422 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderRaw()

bool 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 376 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderSpeedRaw()

bool 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 397 of file FakeLaserWithMotor_motors.cpp.

◆ getEncoderSpeedsRaw()

bool 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 404 of file FakeLaserWithMotor_motors.cpp.

◆ getEncodersRaw()

bool 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 385 of file FakeLaserWithMotor_motors.cpp.

◆ getEncodersTimedRaw()

bool 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()

bool 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()

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

Reimplemented from yarp::dev::IAxisInfoRaw.

Definition at line 631 of file FakeLaserWithMotor_motors.cpp.

◆ getRefAccelerationRaw()

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

◆ getRefAccelerationsRaw() [1/2]

bool FakeLaserWithMotor::getRefAccelerationsRaw ( 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 452 of file FakeLaserWithMotor_motors.cpp.

◆ getRefAccelerationsRaw() [2/2]

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

◆ getRefSpeedRaw()

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

◆ getRefSpeedsRaw() [1/2]

bool FakeLaserWithMotor::getRefSpeedsRaw ( 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 442 of file FakeLaserWithMotor_motors.cpp.

◆ getRefSpeedsRaw() [2/2]

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

◆ getRefVelocitiesRaw() [1/2]

bool FakeLaserWithMotor::getRefVelocitiesRaw ( 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

Reimplemented from yarp::dev::IVelocityControlRaw.

Definition at line 606 of file FakeLaserWithMotor_motors.cpp.

◆ getRefVelocitiesRaw() [2/2]

bool FakeLaserWithMotor::getRefVelocitiesRaw ( 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

Reimplemented from yarp::dev::IVelocityControlRaw.

Definition at line 596 of file FakeLaserWithMotor_motors.cpp.

◆ getRefVelocityRaw()

bool FakeLaserWithMotor::getRefVelocityRaw ( 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

Reimplemented from yarp::dev::IVelocityControlRaw.

Definition at line 590 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetPositionRaw()

bool 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

Reimplemented from yarp::dev::IPositionControlRaw.

Definition at line 522 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetPositionsRaw() [1/2]

bool 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

Reimplemented from yarp::dev::IPositionControlRaw.

Definition at line 546 of file FakeLaserWithMotor_motors.cpp.

◆ getTargetPositionsRaw() [2/2]

bool 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

Reimplemented from yarp::dev::IPositionControlRaw.

Definition at line 537 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. 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).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 32 of file FakeLaserWithMotor.cpp.

◆ positionMoveRaw() [1/3]

bool 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]

bool 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 472 of file FakeLaserWithMotor_motors.cpp.

◆ positionMoveRaw() [3/3]

bool 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 238 of file FakeLaserWithMotor.cpp.

◆ relativeMoveRaw() [1/3]

bool 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]

bool 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 487 of file FakeLaserWithMotor_motors.cpp.

◆ relativeMoveRaw() [3/3]

bool 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()

bool 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 366 of file FakeLaserWithMotor_motors.cpp.

◆ resetEncodersRaw()

bool FakeLaserWithMotor::resetEncodersRaw ( )
overridevirtual

Reset encoders.

Set the encoders value to zero

Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 371 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()

bool FakeLaserWithMotor::setControlModeRaw ( const int  j,
const int  mode 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 290 of file FakeLaserWithMotor_motors.cpp.

◆ setControlModesRaw() [1/2]

bool FakeLaserWithMotor::setControlModesRaw ( const int  n_joint,
const int joints,
int modes 
)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 304 of file FakeLaserWithMotor_motors.cpp.

◆ setControlModesRaw() [2/2]

bool FakeLaserWithMotor::setControlModesRaw ( int modes)
overridevirtual

Implements yarp::dev::IControlModeRaw.

Definition at line 314 of file FakeLaserWithMotor_motors.cpp.

◆ setDistanceRange()

bool 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()

bool 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 356 of file FakeLaserWithMotor_motors.cpp.

◆ setEncodersRaw()

bool 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 361 of file FakeLaserWithMotor_motors.cpp.

◆ setHorizontalResolution()

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

◆ setRefAccelerationRaw()

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

◆ setRefAccelerationsRaw() [1/2]

bool FakeLaserWithMotor::setRefAccelerationsRaw ( const double accs)
overridevirtual

Set reference acceleration on all joints.

This is the valure 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.

◆ setRefAccelerationsRaw() [2/2]

bool FakeLaserWithMotor::setRefAccelerationsRaw ( const int  n_joint,
const int joints,
const double accs 
)
overridevirtual

Set reference acceleration on all joints.

This is the valure 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 432 of file FakeLaserWithMotor_motors.cpp.

◆ setRefSpeedRaw()

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

◆ setRefSpeedsRaw() [1/2]

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

◆ setRefSpeedsRaw() [2/2]

bool FakeLaserWithMotor::setRefSpeedsRaw ( 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 512 of file FakeLaserWithMotor_motors.cpp.

◆ setScanLimits()

bool 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()

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

◆ stopRaw() [1/3]

bool 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]

bool 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 462 of file FakeLaserWithMotor_motors.cpp.

◆ stopRaw() [3/3]

bool 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 316 of file FakeLaserWithMotor.cpp.

◆ velocityMoveRaw() [1/3]

bool 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 572 of file FakeLaserWithMotor_motors.cpp.

◆ velocityMoveRaw() [2/3]

bool 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 580 of file FakeLaserWithMotor_motors.cpp.

◆ velocityMoveRaw() [3/3]

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

Start motion at a given speed, single joint.

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

Implements yarp::dev::IVelocityControlRaw.

Definition at line 556 of file FakeLaserWithMotor_motors.cpp.

Member Data Documentation

◆ _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: