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,
161 bool alloc(
int njoints);
181 bool getAxes(
int* ax)
override;
199 bool positionMoveRaw(
const int n_joint,
const int* joints,
const double* refs)
override;
200 bool relativeMoveRaw(
const int n_joint,
const int* joints,
const double* deltas)
override;
202 bool setRefSpeedsRaw(
const int n_joint,
const int* joints,
const double* spds)
override;
204 bool getRefSpeedsRaw(
const int n_joint,
const int* joints,
double* spds)
override;
206 bool stopRaw(
const int n_joint,
const int* joints)
override;
222 bool velocityMoveRaw(
const int n_joint,
const int* joints,
const double* spds)
override;
234 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 ...
bool setRefSpeedsRaw(const double *spds) override
Set reference speed on all joints.
bool stopRaw() override
Stop motion, multiple joints.
bool setDistanceRange(double min, double max) override
set the device detection range.
bool getEncodersTimedRaw(double *encs, double *stamps) override
Read the instantaneous acceleration of all axes.
bool getEncodersRaw(double *encs) override
Read the position of all axes.
bool getTargetPositionRaw(const int joint, double *ref) override
Get the last position reference for the specified axis.
double * _posCtrl_references
bool setScanRate(double rate) override
set the scan rate (scans per seconds)
bool getEncoderSpeedsRaw(double *spds) override
Read the instantaneous acceleration of an axis.
bool setEncodersRaw(const double *vals) override
Set the value of all encoders.
void run() override
Loop function.
bool getRefSpeedsRaw(double *spds) override
Get reference speed of all joints.
bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type) override
bool setControlModesRaw(const int n_joint, const int *joints, int *modes) override
bool resetEncoderRaw(int j) override
Reset encoder, single joint.
yarp::dev::Nav2D::MapGrid2D m_originally_loaded_map
bool threadInit() override
Initialization method.
bool checkMotionDoneRaw(bool *flag) override
Check if the current trajectory is terminated.
bool close() override
Close the DeviceDriver.
bool getControlModesRaw(int *v) override
bool positionMoveRaw(int j, double ref) override
Set new reference point for a single axis.
bool getRefAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
bool getEncoderRaw(int j, double *v) override
Read the value of an encoder.
bool getEncoderTimedRaw(int j, double *encs, double *stamp) override
Read the instantaneous acceleration of all axes.
FakeLaserWithMotor(double period=0.02)
bool getTargetPositionsRaw(double *refs) override
Get the last position reference for all axes.
bool getControlModeRaw(int j, int *v) override
bool getEncoderSpeedRaw(int j, double *sp) override
Read the instantaneous speed of an axis.
bool getRefVelocityRaw(const int joint, double *ref) override
Get the last reference speed set by velocityMove for single joint.
bool setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
bool getAxisNameRaw(int axis, std::string &name) override
bool resetEncodersRaw() override
Reset encoders.
void threadRelease() override
Release method.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool setRefSpeedRaw(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
std::random_device * m_rd
bool setRefAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
bool getRefAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
bool relativeMoveRaw(int j, double delta) override
Set relative position.
bool getRefVelocitiesRaw(double *refs) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::JointTypeEnum * _jointType
bool getEncoderAccelerationsRaw(double *accs) override
Read the instantaneous acceleration of all axes.
bool setEncoderRaw(int j, double val) override
Set the value of the encoder for a given joint.
bool getEncoderAccelerationRaw(int j, double *spds) override
Read the instantaneous acceleration of an axis.
bool velocityMoveRaw(int j, double sp) override
Start motion at a given speed, single joint.
bool setRefAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool setScanLimits(double min, double max) override
set the scan angular range.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool acquireDataFromHW() override final
This method should be implemented by the user, and contain the logic to grab data from the hardware.
bool getRefSpeedRaw(int j, double *ref) override
Get reference speed for a joint.
std::uniform_real_distribution * m_dis
yarp::dev::Nav2D::MapGrid2D m_map
bool setControlModeRaw(const int j, const int mode) override
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 implementig 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.
The main, catch-all namespace for YARP.