Hello,
I have been running into a recurring issue when trying to run my robot_control_classed.py code with the real robot (fastbot) in part 3 of the Python Basics for Robotics Project, and it seems to be because of an error in the Robot_interface class, which was prewritten. My code works fine with the simulation robot, but for some reason it does not connect to the real robot. I have pasted the error I am receiving below. Thank you.
Exception in thread Thread-1 (spin_node): Traceback (most recent call last): File “/usr/lib/python3.10/threading.py”, line 1016, in _bootstrap_inner self.run() File “/usr/lib/python3.10/threading.py”, line 953, in run self._target(*self._args, **self._kwargs) File “/home/user/ros2_ws/src/python_basics_project/python_basics_project/./robot_control_classed.py”, line 253, in spin_node executor.spin() File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py”, line 294, in spin self.spin_once() File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py”, line 794, in spin_once self._spin_once_impl(timeout_sec) File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py”, line 791, in _spin_once_impl future.result() File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py”, line 94, in result raise self.exception() File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py”, line 239, in call self._handler.send(None) File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py”, line 437, in handler await call_coroutine(entity, arg) File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py”, line 351, in _execute_timer await await_or_execute(tmr.callback) File “/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py”, line 107, in await_or_execute return callback(*args) File “/home/user/ros2_ws/src/python_basics_project/python_basics_project/robot_interface.py”, line198, in control_callback self.twist_cmd.angular.z = self.angular_velocity File “/home/simulations/ros2_sims_ws/install/geometry_msgs/local/lib/python3.10/dist-packages/geometry_msgs/msg/_vector3.py”, line 165, in z assert \