mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 17:30:36 +00:00
feat: all the features
* Move rover-ros2/rover_launch.py to src/anchor_pkg/launch/, renamed to rover.launch.py * Anchor now waits to initialize topics until after it has found a microcontroller. * Headless now waits for anchor to start before it starts itself * Add default cases to motor feedback for motorId * Added black to the flake.nix and package.xml
This commit is contained in:
@@ -48,6 +48,14 @@ class Headless(Node):
|
||||
# Initialize pygame first
|
||||
pygame.init()
|
||||
pygame.joystick.init()
|
||||
super().__init__("headless")
|
||||
|
||||
# Wait for anchor to start
|
||||
pub_info = self.get_publishers_info_by_topic('/anchor/from_vic/debug')
|
||||
while len(pub_info) == 0:
|
||||
self.get_logger().info("Waiting for anchor to start...")
|
||||
time.sleep(1.0)
|
||||
pub_info = self.get_publishers_info_by_topic('/anchor/from_vic/debug')
|
||||
|
||||
# Wait for a gamepad to be connected
|
||||
print("Waiting for gamepad connection...")
|
||||
@@ -65,8 +73,6 @@ class Headless(Node):
|
||||
self.gamepad.init()
|
||||
print(f'Gamepad Found: {self.gamepad.get_name()}')
|
||||
|
||||
# Now initialize the ROS2 node
|
||||
super().__init__("headless")
|
||||
self.create_timer(0.15, self.send_controls)
|
||||
|
||||
self.core_publisher = self.create_publisher(CoreControl, '/core/control', 2)
|
||||
|
||||
Reference in New Issue
Block a user