well, I was a bit lazy to change, and create a new name for a file, so i wrote this program as test_if.py
from robot_control_class import RobotControl
rc = RobotControl()
a = rc.get_laser(360)
while a > 1.0:
rc.move_straight()
a = rc.get_laser(360)
print(rc.get_laser(360))
rc.stop_robot()
the output:
user:~/catkin_ws/src/robot_control$ python test_if.py
[INFO] [1621110856.458113, 0.000000]: Robot Turtlebot…
[INFO] [1621110856.459138, 0.000000]: Checking Laser…
[INFO] [1621110856.493895, 1582.505000]: Checking Laser…DONE
1.5578563213348389
0.5408013463020325
0.20212474465370178
that is it kept banging into the wall,
but if I ran the solution program, it runs perfectly, can someone explain the error I may have committed