33 const double angle_max,
34 const double range_min,
35 const double range_max,
37 const std::int32_t status) :
51 if (!read_angle_min(reader)) {
54 if (!read_angle_max(reader)) {
57 if (!read_range_min(reader)) {
60 if (!read_range_max(reader)) {
63 if (!read_scans(reader)) {
66 if (!read_status(reader)) {
85 if (!write_angle_min(writer)) {
88 if (!write_angle_max(writer)) {
91 if (!write_range_min(writer)) {
94 if (!write_range_max(writer)) {
97 if (!write_scans(writer)) {
100 if (!write_status(writer)) {
113 return write(writer);
140 yarp().setOwner(*
this);
166 return obj !=
nullptr;
185 if (group == 0 && is_dirty) {
192 will_set_angle_min();
194 mark_dirty_angle_min();
202 return obj->angle_min;
220 will_set_angle_max();
222 mark_dirty_angle_max();
230 return obj->angle_max;
248 will_set_range_min();
250 mark_dirty_range_min();
258 return obj->range_min;
276 will_set_range_max();
278 mark_dirty_range_max();
286 return obj->range_max;
383 writer.
writeString(
"send: 'help' or 'patch (param1 val1) (param2 val2)'");
398 if (!writer.
writeTag(
"many", 1, 0)) {
406 if (field ==
"angle_min") {
413 if (!writer.
writeString(
"first angle of the scan [deg]")) {
417 if (field ==
"angle_max") {
424 if (!writer.
writeString(
"last angle of the scan [deg]")) {
428 if (field ==
"range_min") {
435 if (!writer.
writeString(
"the minimum distance of the scan [m]")) {
439 if (field ==
"range_max") {
446 if (!writer.
writeString(
"the maximum distance of the scan [m]")) {
450 if (field ==
"scans") {
454 if (!writer.
writeString(
"yarp::sig::Vector scans")) {
457 if (!writer.
writeString(
"the scan data, measured in [m]. The angular increment of each ray is obtained by (angle_max-angle_min)/num_of_elements. Invalid data are represented as std::inf.")) {
461 if (field ==
"status") {
483 bool have_act =
false;
484 if (tag !=
"patch") {
485 if (((len - 1) % 2) != 0) {
488 len = 1 + ((len - 1) / 2);
492 for (
int i = 1; i < len; ++i) {
506 if (key ==
"angle_min") {
507 will_set_angle_min();
508 if (!obj->nested_read_angle_min(reader)) {
512 }
else if (key ==
"angle_max") {
513 will_set_angle_max();
514 if (!obj->nested_read_angle_max(reader)) {
518 }
else if (key ==
"range_min") {
519 will_set_range_min();
520 if (!obj->nested_read_range_min(reader)) {
524 }
else if (key ==
"range_max") {
525 will_set_range_max();
526 if (!obj->nested_read_range_max(reader)) {
530 }
else if (key ==
"scans") {
532 if (!obj->nested_read_scans(reader)) {
536 }
else if (key ==
"status") {
538 if (!obj->nested_read_status(reader)) {
569 if (is_dirty_angle_min) {
579 if (!obj->nested_write_angle_min(writer)) {
583 if (is_dirty_angle_max) {
593 if (!obj->nested_write_angle_max(writer)) {
597 if (is_dirty_range_min) {
607 if (!obj->nested_write_range_min(writer)) {
611 if (is_dirty_range_max) {
621 if (!obj->nested_write_range_max(writer)) {
625 if (is_dirty_scans) {
635 if (!obj->nested_write_scans(writer)) {
639 if (is_dirty_status) {
649 if (!obj->nested_write_status(writer)) {
657 void LaserScan2D::Editor::communicate()
662 if (
yarp().canWrite()) {
669 void LaserScan2D::Editor::mark_dirty()
675 void LaserScan2D::Editor::mark_dirty_angle_min()
677 if (is_dirty_angle_min) {
681 is_dirty_angle_min =
true;
686 void LaserScan2D::Editor::mark_dirty_angle_max()
688 if (is_dirty_angle_max) {
692 is_dirty_angle_max =
true;
697 void LaserScan2D::Editor::mark_dirty_range_min()
699 if (is_dirty_range_min) {
703 is_dirty_range_min =
true;
708 void LaserScan2D::Editor::mark_dirty_range_max()
710 if (is_dirty_range_max) {
714 is_dirty_range_max =
true;
719 void LaserScan2D::Editor::mark_dirty_scans()
721 if (is_dirty_scans) {
725 is_dirty_scans =
true;
730 void LaserScan2D::Editor::mark_dirty_status()
732 if (is_dirty_status) {
736 is_dirty_status =
true;
741 void LaserScan2D::Editor::dirty_flags(
bool flag)
744 is_dirty_angle_min = flag;
745 is_dirty_angle_max = flag;
746 is_dirty_range_min = flag;
747 is_dirty_range_max = flag;
748 is_dirty_scans = flag;
749 is_dirty_status = flag;
750 dirty_count = flag ? 6 : 0;