7#ifndef FAKE_LASER_WITH_MOTOR_H
8#define FAKE_LASER_WITH_MOTOR_H
87 std::uniform_real_distribution<>*
m_dis;
110 m_rd =
new std::random_device;
112 m_dis =
new std::uniform_real_distribution<>(0, 0.01);
126 bool close()
override;
133 void wall_the_robot(
double siz = 1.0,
double dist = 1.0);
134 void obst_the_robot(
double siz = 1.0,
double dist = 1.0);
135 void trap_the_robot(
double siz = 1.0);
136 void free_the_robot();
139 bool LiangBarsky_clip(
int edgeLeft,
int edgeRight,
int edgeTop,
int edgeBottom,
162 bool alloc(
int njoints);
236 bool read(
yarp::os::ConnectionReader& connection) override;
define control board standard interfaces
contains the definition of a map type
contains the definition of a Vector type
This class is the parameters parser for class FakeLaserWithMotor.
fakeLaserWithMotor : fake sensor device driver for testing purposes and reference for IRangefinder2D ...
yarp::dev::ReturnValue getTrajSpeedRaw(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue setTrajAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue getEncoderSpeedRaw(int j, double *sp) override
Read the instantaneous speed of an axis.
double * _posCtrl_references
void run() override
Loop function.
yarp::dev::ReturnValue positionMoveRaw(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue setDistanceRange(double min, double max) override
set the device detection range.
yarp::dev::ReturnValue setTrajAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
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 getTrajAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue getTargetVelocitiesRaw(double *refs) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::Nav2D::MapGrid2D m_originally_loaded_map
yarp::dev::ReturnValue getControlModeRaw(int j, yarp::dev::ControlModeEnum &mode) override
bool threadInit() override
Initialization method.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue checkMotionDoneRaw(bool &flag) override
Check if the current trajectory all joints is terminated.
yarp::dev::ReturnValue getEncoderTimedRaw(int j, double *encs, double *stamp) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getTrajSpeedsRaw(double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue relativeMoveRaw(int j, double delta) override
Set relative position.
yarp::dev::ReturnValue setControlModeRaw(int j, yarp::dev::SelectableControlModeEnum mode) override
yarp::dev::ReturnValue getAxisNameRaw(int axis, std::string &name) override
FakeLaserWithMotor(double period=0.02)
yarp::dev::ReturnValue getTargetPositionRaw(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue getTrajAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
yarp::dev::ReturnValue getEncodersRaw(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue getControlModesRaw(std::vector< yarp::dev::ControlModeEnum > &mode) override
yarp::dev::ReturnValue getEncodersTimedRaw(double *encs, double *stamps) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type) override
yarp::dev::ReturnValue velocityMoveRaw(int j, double sp) override
Start motion at a given speed, single joint.
void threadRelease() override
Release method.
yarp::dev::ReturnValue setScanRate(double rate) override
set the scan rate (scans per seconds)
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue getTargetPositionsRaw(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue setEncoderRaw(int j, double val) override
Set the value of the encoder for a given joint.
yarp::dev::ReturnValue setControlModesRaw(const std::vector< int > &j, const std::vector< yarp::dev::SelectableControlModeEnum > &mode) override
yarp::dev::ReturnValue getTargetVelocityRaw(const int joint, double *ref) override
Get the last reference speed set by velocityMove for single joint.
std::random_device * m_rd
yarp::dev::ReturnValue resetEncodersRaw() override
Reset encoders.
yarp::dev::JointTypeEnum * _jointType
yarp::dev::ReturnValue getAvailableControlModesRaw(int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail) override
yarp::dev::ReturnValue setTrajSpeedsRaw(const double *spds) override
Set reference speed on all joints.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::dev::ReturnValue setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
std::vector< yarp::dev::SelectableControlModeEnum > * _availableControlModes
bool acquireDataFromHW() override final
This method should be implemented by the user, and contain the logic to grab data from the hardware.
yarp::dev::ReturnValue setEncodersRaw(const double *vals) override
Set the value of all encoders.
yarp::dev::ReturnValue getEncoderSpeedsRaw(double *spds) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue setScanLimits(double min, double max) override
set the scan angular range.
yarp::dev::ReturnValue resetEncoderRaw(int j) override
Reset encoder, single joint.
std::uniform_real_distribution * m_dis
yarp::dev::ReturnValue getEncoderAccelerationRaw(int j, double *spds) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue stopRaw() override
Stop motion, multiple joints.
yarp::dev::Nav2D::MapGrid2D m_map
yarp::dev::ReturnValue getEncoderRaw(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue getEncoderAccelerationsRaw(double *accs) override
Read the instantaneous acceleration of all axes.
Interface implemented by all device drivers.
Interface for getting information about specific axes, if available.
Interface for setting control mode in control board.
Control board, extend encoder raw interface adding timestamps.
Interface for a generic control board device implementing position control in encoder coordinates.
Interface for control boards implementing velocity control in encoder coordinates.
ImplementAxisInfo(yarp::dev::IAxisInfoRaw *y)
ImplementControlMode(IControlModeRaw *v)
ImplementEncodersTimed(yarp::dev::IEncodersTimedRaw *y)
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
ImplementInteractionMode(yarp::dev::IInteractionModeRaw *Class_p)
Constructor.
Default implementation of the IPositionControl interface.
ImplementPositionControl(yarp::dev::IPositionControlRaw *y)
Constructor.
ImplementVelocityControl(yarp::dev::IVelocityControlRaw *y)
Constructor.
The Lidar2DDeviceBase class.
Stub implementation of IInteractionMode interface.
An abstraction for a periodic thread.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
Constructor.
void step()
Call this to "step" the thread rather than starting it.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
A mini-server for network communication.
A base class for nested structures that can be searched.
yarp::math::Vec2D< int > XYCell_unbounded
yarp::math::Vec2D< size_t > XYCell
SelectableControlModeEnum
The main, catch-all namespace for YARP.