Skip to content

Commit a9eee7e

Browse files
committed
fixed update tof
1 parent 305ebd8 commit a9eee7e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/firmware_01/firmware_01.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ void loop(){
121121
robot.serial->write(packeter.msg,msg_size);
122122
break;
123123
case 3:
124-
tof.update();
125-
msg_size = packeter.packetC7I('f', tof.getLeft(), tof.getCenterLeft(), tof.getCenter(), tof.getCenterRight(), tof.getRight(), tof.get_min_range_top_mm(), tof.get_max_range_bottom_mm());
126-
robot.serial->write(packeter.msg,msg_size);
124+
if (tof.update_rois()){
125+
msg_size = packeter.packetC7I('f', tof.getLeft(), tof.getCenterLeft(), tof.getCenter(), tof.getCenterRight(), tof.getRight(), tof.get_min_range_top_mm(), tof.get_max_range_bottom_mm());
126+
robot.serial->write(packeter.msg,msg_size);
127+
}
127128
break;
128129
case 4:
129130
msg_size = packeter.packetC3F('q', robot.getRoll(), robot.getPitch(), robot.getYaw());

0 commit comments

Comments
 (0)