35 yCError(MOBVEL_NWS_YARP,
"received data on streaming port, but no device attached yet");
49 yCError(MOBVEL_NWS_YARP,
"open() error you have to provide a valid 'local' param");
55 std::string local_rpc_1;
60 yCError(MOBVEL_NWS_YARP,
"open() error could not open rpc port %s, check network", local_rpc_1.c_str());
66 yCError(MOBVEL_NWS_YARP,
"Error! Cannot attach the port as a server");
73 std::string local_stream_1;
78 yCError(MOBVEL_NWS_YARP,
"open() error could not open port %s, check network", local_stream_1.c_str());
86 if (config.
check(
"subdevice"))
94 yCError(MOBVEL_NWS_YARP) <<
"Failed to open subdevice.. check params";
100 yCError(MOBVEL_NWS_YARP) <<
"Failed to attach subdevice.. check params";
106 yCInfo(MOBVEL_NWS_YARP) <<
"Waiting for device to attach";
135 yCError(MOBVEL_NWS_YARP,
"Subdevice passed to attach method is invalid");
145 std::lock_guard <std::mutex> lg(
m_mutex);
148 yCError(MOBVEL_NWS_YARP,
"Unable to applyVelocityCommandRPC");
156 yCError(MOBVEL_NWS_YARP,
"Unable to applyVelocityCommandRPC");
165 std::lock_guard <std::mutex> lg(
m_mutex);
168 yCError(MOBVEL_NWS_YARP,
"Unable to getLastVelocityCommand");
170 return retrievedFromRPC;
179 retrievedFromRPC.
x_vel = x_vel;
180 retrievedFromRPC.
y_vel = x_vel;
182 return retrievedFromRPC;
bool detach() override
Detach the object (you must have first called attach).
yarp::os::Port m_rpc_port_navigation_server
VelocityInputPortProcessor m_StreamingInput
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::PolyDriver m_subdev
bool attach(yarp::dev::PolyDriver *driver) override
Attach to another object.
return_getLastVelocityCommand getLastVelocityCommandRPC() override
yarp::dev::Nav2D::INavigation2DVelocityActions * m_iNavVel
bool applyVelocityCommandRPC(const double x_vel, const double y_vel, const double theta_vel, const double timeout) override
bool view(T *&x)
Get an interface to the device driver.
double vel_theta
angular velocity of the robot [deg/s]
double vel_y
velocity of the robot [m/s]
double vel_x
velocity of the robot [m/s]
virtual bool applyVelocityCommand(double x_vel, double y_vel, double theta_vel, double timeout=0.1)=0
Apply a velocity command.
virtual bool getLastVelocityCommand(double &x_vel, double &y_vel, double &theta_vel)=0
Returns the last applied velocity command.
A container for a device driver.
bool close() override
Close the DeviceDriver.
bool isValid() const
Check if device is valid.
bool open(const std::string &txt)
Construct and configure a device by its common name.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
void setStrict(bool strict=true) override
Call this to strictly keep all messages, or allow old ones to be quietly dropped.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A class for storing options and configuration information.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual std::string asString() const
Get string value.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.