37 const double odom_theta,
38 const double base_vel_x,
39 const double base_vel_y,
40 const double base_vel_theta,
41 const double odom_vel_x,
42 const double odom_vel_y,
43 const double odom_vel_theta) :
47 odom_theta(odom_theta),
48 base_vel_x(base_vel_x),
49 base_vel_y(base_vel_y),
50 base_vel_theta(base_vel_theta),
51 odom_vel_x(odom_vel_x),
52 odom_vel_y(odom_vel_y),
53 odom_vel_theta(odom_vel_theta)
60 if (!read_odom_x(reader)) {
63 if (!read_odom_y(reader)) {
66 if (!read_odom_theta(reader)) {
69 if (!read_base_vel_x(reader)) {
72 if (!read_base_vel_y(reader)) {
75 if (!read_base_vel_theta(reader)) {
78 if (!read_odom_vel_x(reader)) {
81 if (!read_odom_vel_y(reader)) {
84 if (!read_odom_vel_theta(reader)) {
103 if (!write_odom_x(writer)) {
106 if (!write_odom_y(writer)) {
109 if (!write_odom_theta(writer)) {
112 if (!write_base_vel_x(writer)) {
115 if (!write_base_vel_y(writer)) {
118 if (!write_base_vel_theta(writer)) {
121 if (!write_odom_vel_x(writer)) {
124 if (!write_odom_vel_y(writer)) {
127 if (!write_odom_vel_theta(writer)) {
140 return write(writer);
167 yarp().setOwner(*
this);
193 return obj !=
nullptr;
212 if (group == 0 && is_dirty) {
275 will_set_odom_theta();
277 mark_dirty_odom_theta();
279 did_set_odom_theta();
285 return obj->odom_theta;
303 will_set_base_vel_x();
305 mark_dirty_base_vel_x();
307 did_set_base_vel_x();
313 return obj->base_vel_x;
331 will_set_base_vel_y();
333 mark_dirty_base_vel_y();
335 did_set_base_vel_y();
341 return obj->base_vel_y;
359 will_set_base_vel_theta();
361 mark_dirty_base_vel_theta();
363 did_set_base_vel_theta();
369 return obj->base_vel_theta;
387 will_set_odom_vel_x();
389 mark_dirty_odom_vel_x();
391 did_set_odom_vel_x();
397 return obj->odom_vel_x;
415 will_set_odom_vel_y();
417 mark_dirty_odom_vel_y();
419 did_set_odom_vel_y();
425 return obj->odom_vel_y;
443 will_set_odom_vel_theta();
445 mark_dirty_odom_vel_theta();
447 did_set_odom_vel_theta();
453 return obj->odom_vel_theta;
494 writer.
writeString(
"send: 'help' or 'patch (param1 val1) (param2 val2)'");
509 if (!writer.
writeTag(
"many", 1, 0)) {
517 if (field ==
"odom_x") {
524 if (!writer.
writeString(
"position of the robot [m], expressed in the world reference frame")) {
528 if (field ==
"odom_y") {
535 if (!writer.
writeString(
"position of the robot [m], expressed in the world reference frame")) {
539 if (field ==
"odom_theta") {
546 if (!writer.
writeString(
"orientation the robot [deg], expressed in the world reference frame")) {
550 if (field ==
"base_vel_x") {
557 if (!writer.
writeString(
"velocity of the robot [m/s] expressed in the robot reference frame")) {
561 if (field ==
"base_vel_y") {
568 if (!writer.
writeString(
"velocity of the robot [m/s] expressed in the robot reference frame")) {
572 if (field ==
"base_vel_theta") {
576 if (!writer.
writeString(
"double base_vel_theta")) {
579 if (!writer.
writeString(
"angular velocity of the robot [deg/s] expressed in the robot reference frame")) {
583 if (field ==
"odom_vel_x") {
590 if (!writer.
writeString(
"velocity of the robot [m/s] expressed in the world reference frame")) {
594 if (field ==
"odom_vel_y") {
601 if (!writer.
writeString(
"velocity of the robot [m/s] expressed in the world reference frame")) {
605 if (field ==
"odom_vel_theta") {
609 if (!writer.
writeString(
"double odom_vel_theta")) {
612 if (!writer.
writeString(
"angular velocity of the robot [deg/s] expressed in the world reference frame")) {
633 bool have_act =
false;
634 if (tag !=
"patch") {
635 if (((len - 1) % 2) != 0) {
638 len = 1 + ((len - 1) / 2);
642 for (
int i = 1; i < len; ++i) {
656 if (key ==
"odom_x") {
658 if (!obj->nested_read_odom_x(reader)) {
662 }
else if (key ==
"odom_y") {
664 if (!obj->nested_read_odom_y(reader)) {
668 }
else if (key ==
"odom_theta") {
669 will_set_odom_theta();
670 if (!obj->nested_read_odom_theta(reader)) {
673 did_set_odom_theta();
674 }
else if (key ==
"base_vel_x") {
675 will_set_base_vel_x();
676 if (!obj->nested_read_base_vel_x(reader)) {
679 did_set_base_vel_x();
680 }
else if (key ==
"base_vel_y") {
681 will_set_base_vel_y();
682 if (!obj->nested_read_base_vel_y(reader)) {
685 did_set_base_vel_y();
686 }
else if (key ==
"base_vel_theta") {
687 will_set_base_vel_theta();
688 if (!obj->nested_read_base_vel_theta(reader)) {
691 did_set_base_vel_theta();
692 }
else if (key ==
"odom_vel_x") {
693 will_set_odom_vel_x();
694 if (!obj->nested_read_odom_vel_x(reader)) {
697 did_set_odom_vel_x();
698 }
else if (key ==
"odom_vel_y") {
699 will_set_odom_vel_y();
700 if (!obj->nested_read_odom_vel_y(reader)) {
703 did_set_odom_vel_y();
704 }
else if (key ==
"odom_vel_theta") {
705 will_set_odom_vel_theta();
706 if (!obj->nested_read_odom_vel_theta(reader)) {
709 did_set_odom_vel_theta();
737 if (is_dirty_odom_x) {
747 if (!obj->nested_write_odom_x(writer)) {
751 if (is_dirty_odom_y) {
761 if (!obj->nested_write_odom_y(writer)) {
765 if (is_dirty_odom_theta) {
775 if (!obj->nested_write_odom_theta(writer)) {
779 if (is_dirty_base_vel_x) {
789 if (!obj->nested_write_base_vel_x(writer)) {
793 if (is_dirty_base_vel_y) {
803 if (!obj->nested_write_base_vel_y(writer)) {
807 if (is_dirty_base_vel_theta) {
817 if (!obj->nested_write_base_vel_theta(writer)) {
821 if (is_dirty_odom_vel_x) {
831 if (!obj->nested_write_odom_vel_x(writer)) {
835 if (is_dirty_odom_vel_y) {
845 if (!obj->nested_write_odom_vel_y(writer)) {
849 if (is_dirty_odom_vel_theta) {
859 if (!obj->nested_write_odom_vel_theta(writer)) {
867 void OdometryData::Editor::communicate()
872 if (
yarp().canWrite()) {
879 void OdometryData::Editor::mark_dirty()
885 void OdometryData::Editor::mark_dirty_odom_x()
887 if (is_dirty_odom_x) {
891 is_dirty_odom_x =
true;
896 void OdometryData::Editor::mark_dirty_odom_y()
898 if (is_dirty_odom_y) {
902 is_dirty_odom_y =
true;
907 void OdometryData::Editor::mark_dirty_odom_theta()
909 if (is_dirty_odom_theta) {
913 is_dirty_odom_theta =
true;
918 void OdometryData::Editor::mark_dirty_base_vel_x()
920 if (is_dirty_base_vel_x) {
924 is_dirty_base_vel_x =
true;
929 void OdometryData::Editor::mark_dirty_base_vel_y()
931 if (is_dirty_base_vel_y) {
935 is_dirty_base_vel_y =
true;
940 void OdometryData::Editor::mark_dirty_base_vel_theta()
942 if (is_dirty_base_vel_theta) {
946 is_dirty_base_vel_theta =
true;
951 void OdometryData::Editor::mark_dirty_odom_vel_x()
953 if (is_dirty_odom_vel_x) {
957 is_dirty_odom_vel_x =
true;
962 void OdometryData::Editor::mark_dirty_odom_vel_y()
964 if (is_dirty_odom_vel_y) {
968 is_dirty_odom_vel_y =
true;
973 void OdometryData::Editor::mark_dirty_odom_vel_theta()
975 if (is_dirty_odom_vel_theta) {
979 is_dirty_odom_vel_theta =
true;
984 void OdometryData::Editor::dirty_flags(
bool flag)
987 is_dirty_odom_x = flag;
988 is_dirty_odom_y = flag;
989 is_dirty_odom_theta = flag;
990 is_dirty_base_vel_x = flag;
991 is_dirty_base_vel_y = flag;
992 is_dirty_base_vel_theta = flag;
993 is_dirty_odom_vel_x = flag;
994 is_dirty_odom_vel_y = flag;
995 is_dirty_odom_vel_theta = flag;
996 dirty_count = flag ? 9 : 0;
virtual bool did_set_odom_x()
virtual bool did_set_odom_vel_x()
virtual bool will_set_odom_vel_theta()
virtual bool did_set_odom_theta()
virtual bool will_set_base_vel_y()
virtual bool did_set_odom_y()
double get_odom_vel_x() const
void set_odom_theta(const double odom_theta)
double get_odom_vel_y() const
virtual bool did_set_base_vel_x()
double get_base_vel_y() const
virtual bool did_set_odom_vel_theta()
void set_odom_vel_theta(const double odom_vel_theta)
virtual bool will_set_odom_theta()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
virtual bool will_set_base_vel_x()
void set_odom_x(const double odom_x)
void set_base_vel_theta(const double base_vel_theta)
void set_base_vel_y(const double base_vel_y)
virtual bool will_set_odom_x()
void set_odom_vel_y(const double odom_vel_y)
virtual bool did_set_base_vel_y()
void set_odom_y(const double odom_y)
double get_base_vel_x() const
double get_odom_y() const
void set_odom_vel_x(const double odom_vel_x)
double get_base_vel_theta() const
virtual bool will_set_odom_vel_x()
double get_odom_theta() const
bool edit(OdometryData &obj, bool dirty=true)
double get_odom_vel_theta() const
virtual bool did_set_base_vel_theta()
virtual bool will_set_odom_y()
virtual bool did_set_odom_vel_y()
virtual bool will_set_odom_vel_y()
double get_odom_x() const
void set_base_vel_x(const double base_vel_x)
virtual bool will_set_base_vel_theta()
double base_vel_x
velocity of the robot [m/s] expressed in the robot reference frame
double odom_vel_y
velocity of the robot [m/s] expressed in the world reference frame
double base_vel_theta
angular velocity of the robot [deg/s] expressed in the robot reference frame
double odom_vel_theta
angular velocity of the robot [deg/s] expressed in the world reference frame
double base_vel_y
velocity of the robot [m/s] expressed in the robot reference frame
bool read(yarp::os::idl::WireReader &reader) override
double odom_x
position of the robot [m], expressed in the world reference frame
std::string toString() const
double odom_y
position of the robot [m], expressed in the world reference frame
double odom_theta
orientation the robot [deg], expressed in the world reference frame
double odom_vel_x
velocity of the robot [m/s] expressed in the world reference frame
bool write(const yarp::os::idl::WireWriter &writer) const override
A simple collection of objects that can be described and transmitted in a portable way.
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
An interface for reading from a network connection.
An interface for writing to a network connection.
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
bool readFloat64(yarp::conf::float64_t &x)
IDL-friendly connection writer.
bool writeListHeader(int len) const
bool writeTag(const char *tag, int split, int len) const
bool writeFloat64(yarp::conf::float64_t x) const
bool writeString(const std::string &tag) const
bool writeVocab(std::int32_t x) const
bool isValid()
Check if time is valid (non-zero).
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
The main, catch-all namespace for YARP.