|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
26 const double timestamp) :
28 measurement(measurement),
36 if (!read_measurement(reader)) {
39 if (!read_timestamp(reader)) {
58 if (!write_measurement(writer)) {
61 if (!write_timestamp(writer)) {
101 yarp().setOwner(*
this);
127 return obj !=
nullptr;
146 if (group == 0 && is_dirty) {
153 will_set_measurement();
155 mark_dirty_measurement();
157 did_set_measurement();
163 return obj->measurement;
181 will_set_timestamp();
183 mark_dirty_timestamp();
191 return obj->timestamp;
232 writer.
writeString(
"send: 'help' or 'patch (param1 val1) (param2 val2)'");
247 if (!writer.
writeTag(
"many", 1, 0)) {
255 if (field ==
"measurement") {
259 if (!writer.
writeString(
"yarp::sig::Vector measurement")) {
263 if (field ==
"timestamp") {
281 bool have_act =
false;
282 if (tag !=
"patch") {
283 if (((len - 1) % 2) != 0) {
286 len = 1 + ((len - 1) / 2);
290 for (
int i = 1; i < len; ++i) {
304 if (key ==
"measurement") {
305 will_set_measurement();
306 if (!obj->nested_read_measurement(reader)) {
309 did_set_measurement();
310 }
else if (key ==
"timestamp") {
311 will_set_timestamp();
312 if (!obj->nested_read_timestamp(reader)) {
343 if (is_dirty_measurement) {
353 if (!obj->nested_write_measurement(writer)) {
357 if (is_dirty_timestamp) {
367 if (!obj->nested_write_timestamp(writer)) {
375 void SensorMeasurement::Editor::communicate()
380 if (
yarp().canWrite()) {
387 void SensorMeasurement::Editor::mark_dirty()
393 void SensorMeasurement::Editor::mark_dirty_measurement()
395 if (is_dirty_measurement) {
399 is_dirty_measurement =
true;
404 void SensorMeasurement::Editor::mark_dirty_timestamp()
406 if (is_dirty_timestamp) {
410 is_dirty_timestamp =
true;
415 void SensorMeasurement::Editor::dirty_flags(
bool flag)
418 is_dirty_measurement = flag;
419 is_dirty_timestamp = flag;
420 dirty_count = flag ? 2 : 0;
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
A simple collection of objects that can be described and transmitted in a portable way.
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)
bool write(const yarp::os::idl::WireWriter &writer) const override
bool writeFloat64(yarp::conf::float64_t x) const
bool setOwner(yarp::os::PortReader &owner)
Set the owner of this WireLink.
bool isValid()
Check if time is valid (non-zero).
yarp::sig::Vector measurement
bool edit(SensorMeasurement &obj, bool dirty=true)
bool writeString(const std::string &tag) const
double get_timestamp() const
bool writeListHeader(int len) const
void set_measurement(const yarp::sig::Vector &measurement)
bool read(yarp::os::idl::WireReader &reader) override
bool writeNested(const WirePortable &obj) const
IDL-friendly connection writer.
An interface for writing to a network connection.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(const WirePortable &obj) const
virtual bool did_set_measurement()
bool readNested(WirePortable &obj)
bool read(WirePortable &obj)
bool writeTag(const char *tag, int split, int len) const
IDL-friendly connection reader.
An interface for reading from a network connection.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
bool writeVocab(std::int32_t x) const
virtual bool will_set_measurement()
The main, catch-all namespace for YARP.
virtual bool will_set_timestamp()
std::string toString() const
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
virtual bool did_set_timestamp()
SensorMeasurement & state()
bool readFloat64(yarp::conf::float64_t &x)
const yarp::sig::Vector & get_measurement() const
void set_timestamp(const double timestamp)