|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
31 const double vel_theta) :
42 if (!read_vel_x(reader)) {
45 if (!read_vel_y(reader)) {
48 if (!read_vel_theta(reader)) {
67 if (!write_vel_x(writer)) {
70 if (!write_vel_y(writer)) {
73 if (!write_vel_theta(writer)) {
113 yarp().setOwner(*
this);
139 return obj !=
nullptr;
158 if (group == 0 && is_dirty) {
221 will_set_vel_theta();
223 mark_dirty_vel_theta();
231 return obj->vel_theta;
272 writer.
writeString(
"send: 'help' or 'patch (param1 val1) (param2 val2)'");
287 if (!writer.
writeTag(
"many", 1, 0)) {
295 if (field ==
"vel_x") {
302 if (!writer.
writeString(
"velocity of the robot [m/s]")) {
306 if (field ==
"vel_y") {
313 if (!writer.
writeString(
"velocity of the robot [m/s]")) {
317 if (field ==
"vel_theta") {
324 if (!writer.
writeString(
"angular velocity of the robot [deg/s]")) {
339 bool have_act =
false;
340 if (tag !=
"patch") {
341 if (((len - 1) % 2) != 0) {
344 len = 1 + ((len - 1) / 2);
348 for (
int i = 1; i < len; ++i) {
362 if (key ==
"vel_x") {
364 if (!obj->nested_read_vel_x(reader)) {
368 }
else if (key ==
"vel_y") {
370 if (!obj->nested_read_vel_y(reader)) {
374 }
else if (key ==
"vel_theta") {
375 will_set_vel_theta();
376 if (!obj->nested_read_vel_theta(reader)) {
407 if (is_dirty_vel_x) {
417 if (!obj->nested_write_vel_x(writer)) {
421 if (is_dirty_vel_y) {
431 if (!obj->nested_write_vel_y(writer)) {
435 if (is_dirty_vel_theta) {
445 if (!obj->nested_write_vel_theta(writer)) {
453 void MobileBaseVelocity::Editor::communicate()
458 if (
yarp().canWrite()) {
465 void MobileBaseVelocity::Editor::mark_dirty()
471 void MobileBaseVelocity::Editor::mark_dirty_vel_x()
473 if (is_dirty_vel_x) {
477 is_dirty_vel_x =
true;
482 void MobileBaseVelocity::Editor::mark_dirty_vel_y()
484 if (is_dirty_vel_y) {
488 is_dirty_vel_y =
true;
493 void MobileBaseVelocity::Editor::mark_dirty_vel_theta()
495 if (is_dirty_vel_theta) {
499 is_dirty_vel_theta =
true;
504 void MobileBaseVelocity::Editor::dirty_flags(
bool flag)
507 is_dirty_vel_x = flag;
508 is_dirty_vel_y = flag;
509 is_dirty_vel_theta = flag;
510 dirty_count = flag ? 3 : 0;
A simple collection of objects that can be described and transmitted in a portable way.
void set_vel_y(const double vel_y)
std::string toString() const override
Gives a human-readable textual representation of the bottle.
bool readString(std::string &str, bool *is_vocab=nullptr)
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
virtual bool will_set_vel_theta()
bool writeFloat64(yarp::conf::float64_t x) const
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
double vel_y
velocity of the robot [m/s]
double get_vel_theta() const
virtual bool will_set_vel_x()
bool isValid()
Check if time is valid (non-zero).
bool write(const yarp::os::idl::WireWriter &writer) const override
virtual bool did_set_vel_y()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool writeString(const std::string &tag) const
void set_vel_theta(const double vel_theta)
bool writeListHeader(int len) const
IDL-friendly connection writer.
double vel_theta
angular velocity of the robot [deg/s]
virtual bool did_set_vel_theta()
virtual bool will_set_vel_y()
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool edit(MobileBaseVelocity &obj, bool dirty=true)
An interface for writing to a network connection.
MobileBaseVelocity & state()
void set_vel_x(const double vel_x)
bool read(yarp::os::idl::WireReader &reader) override
bool writeTag(const char *tag, int split, int len) const
IDL-friendly connection reader.
An interface for reading from a network connection.
virtual bool did_set_vel_x()
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
double vel_x
velocity of the robot [m/s]
bool writeVocab(std::int32_t x) const
The main, catch-all namespace for YARP.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
bool readFloat64(yarp::conf::float64_t &x)
std::string toString() const