Migrate to a new physical robot

Uses the mecanum controller properly across physical and virtual
There is a timing issue with i2c which is why the control update is limited to 10hz
The sonar and LED's arent yet working, this will come soon.
This commit is contained in:
2026-05-27 13:25:20 +00:00
parent c1319a6357
commit ec554bcf2c
96 changed files with 2874 additions and 3730 deletions
+6 -5
View File
@@ -2,7 +2,7 @@ import threading
import xml.etree.ElementTree as ET
import rclpy
from geometry_msgs.msg import Twist
from geometry_msgs.msg import TwistStamped
from rclpy.node import Node
from rclpy.qos import DurabilityPolicy, QoSProfile, ReliabilityPolicy
from sensor_msgs.msg import JointState, Range
@@ -39,7 +39,7 @@ class RobotBridgeNode(Node):
def __init__(self):
super().__init__('webui_bridge')
self._cmd_vel_pub = self.create_publisher(Twist, '/cmd_vel', 10)
self._cmd_vel_pub = self.create_publisher(TwistStamped, '/cmd_vel', 10)
self._joint_cmd_pub = self.create_publisher(JointState, '/joint_command', 10)
self._led_color_pub = self.create_publisher(ColorRGBA, '/led/color', 10)
self._led_effect_pub = self.create_publisher(String, '/led/effect', 10)
@@ -59,9 +59,10 @@ class RobotBridgeNode(Node):
# ------------------------------------------------------------------
def publish_cmd_vel(self, linear_x: float, angular_z: float) -> None:
msg = Twist()
msg.linear.x = float(linear_x)
msg.angular.z = float(angular_z)
msg = TwistStamped()
msg.header.stamp = self.get_clock().now().to_msg()
msg.twist.linear.x = float(linear_x)
msg.twist.angular.z = float(angular_z)
self._cmd_vel_pub.publish(msg)
def publish_joint_command(self, pan: float, tilt: float) -> None: