diff --git a/.codex b/.codex new file mode 100644 index 00000000..e69de29b diff --git a/.gitignore b/.gitignore index 86668ec0..2bf691f1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build/ install/ log/ .vscode/ +.codex # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/src/bringup/scripts/controller_switcher.py b/src/bringup/scripts/controller_switcher.py index 2f8c3736..53dd378e 100755 --- a/src/bringup/scripts/controller_switcher.py +++ b/src/bringup/scripts/controller_switcher.py @@ -40,7 +40,7 @@ def __init__(self): self.client_cb_group = MutuallyExclusiveCallbackGroup() # Controllers to always keep active or ignore - self.always_active = ["joint_state_broadcaster", "motor_status_broadcaster"] + self.always_active = ["joint_state_broadcaster", "motor_status_broadcaster", "led_gpio_controller", "killswitch_gpio_controller", "laser_gpio_controller"] self.ignore_controllers = [] # Lock to prevent concurrent service processing @@ -117,11 +117,14 @@ def _handle_set_controller(self, request, response): # Extract controller names and their states all_controllers = [] active_controllers = [] + valid_always_active = [] for c in list_result.controller: all_controllers.append(c.name) if c.state == 'active': active_controllers.append(c.name) + valid_always_active = [c for c in self.always_active if c in all_controllers] + self.get_logger().info(f"Available controllers: {all_controllers}") self.get_logger().info(f"Currently active: {active_controllers}") @@ -282,10 +285,10 @@ def controller_handler(controller, subsystem_controllers): if switch_result and switch_result.ok: response.success = True if requested_controllers: - active_list = requested_controllers + self.always_active + active_list = requested_controllers + valid_always_active response.message = f"Successfully activated controllers: {requested_controllers}. Active: {active_list}" else: - response.message = f"Successfully deactivated all controllers except: {self.always_active + self.ignore_controllers}" + response.message = f"Successfully deactivated all controllers except: {valid_always_active + self.ignore_controllers}" self.get_logger().info(f"Success! {response.message}") else: response.success = False diff --git a/src/description/ros2_control/drive/drive.odrive.ros2_control.xacro b/src/description/ros2_control/drive/drive.odrive.ros2_control.xacro index e584d59e..931dc89e 100644 --- a/src/description/ros2_control/drive/drive.odrive.ros2_control.xacro +++ b/src/description/ros2_control/drive/drive.odrive.ros2_control.xacro @@ -9,6 +9,30 @@ can0 + + + 0 + 26 + + + + 0.0 + + + + + + + 1 + 26 + + + + 0.0 + + + + 7 26 diff --git a/src/subsystems/arm/README.md b/src/subsystems/arm/README.md index a1a91fc3..83c459aa 100644 --- a/src/subsystems/arm/README.md +++ b/src/subsystems/arm/README.md @@ -8,7 +8,7 @@
  • athena_arm_controllers: contains athena arm manual controller
  • athena_arm_description: contains the full urdf file for the arm including ros2_control urdfs
  • athena_arm_moveit: contains athena arm moveit setup
  • -
  • athena_arm_msgs: contains messages used for athena mainly for logging
  • +
  • msgs: contains messages used for athena mainly for logging
  • manual_control: testing setup to control each motor on the arm with a PS4 controller. We now have a controller in the ros2_control setup that does the same thing
  • ros_odrive: contains node and ros2_control hardware interface for ODrives.
  • smc_ros2_control: contains ros2_control hardware interface for SMC motors
  • diff --git a/src/subsystems/arm/arm_bringup/launch/athena_arm.jetson.launch.py b/src/subsystems/arm/arm_bringup/launch/athena_arm.jetson.launch.py index 11594daf..a3facf4e 100644 --- a/src/subsystems/arm/arm_bringup/launch/athena_arm.jetson.launch.py +++ b/src/subsystems/arm/arm_bringup/launch/athena_arm.jetson.launch.py @@ -90,7 +90,7 @@ def generate_launch_description(): ) controller_switcher_config = PathJoinSubstitution( - [FindPackageShare("bringup"), "config", "controller_switcher.yaml"] + [FindPackageShare(runtime_config_package), "config", "controller_switcher.yaml"] ) # -- Additional Configuration Setup -- diff --git a/src/subsystems/drive/README.md b/src/subsystems/drive/README.md index 16359cc0..fdddc5e8 100644 --- a/src/subsystems/drive/README.md +++ b/src/subsystems/drive/README.md @@ -74,6 +74,6 @@ ros2 launch drive_bringup athena_drive.launch.py mode:=base_station **Open another terminal, source the workspace, and call the service to set controllers:** ```bash source install/setup.bash -ros2 service call /set_controller athena_drive_msgs/srv/SetController "{controller_names: [INCLUDE CONTROLLER(S) YOU WANT WITHIN BRACKETS]}" +ros2 service call /set_controller msgs/srv/SetController "{controller_names: [INCLUDE CONTROLLER(S) YOU WANT WITHIN BRACKETS]}" ``` -Example: `ros2 service call /set_controller athena_drive_msgs/srv/SetController "{controller_names: [drive_velocity_controller]}"` \ No newline at end of file +Example: `ros2 service call /set_controller msgs/srv/SetController "{controller_names: [drive_velocity_controller]}"` \ No newline at end of file diff --git a/src/subsystems/drive/drive_bringup/launch/athena_drive.launch.py b/src/subsystems/drive/drive_bringup/launch/athena_drive.launch.py index a939508f..b5440b9f 100644 --- a/src/subsystems/drive/drive_bringup/launch/athena_drive.launch.py +++ b/src/subsystems/drive/drive_bringup/launch/athena_drive.launch.py @@ -148,7 +148,7 @@ def launch_setup(context, *args, **kwargs): ) controller_switcher_config = PathJoinSubstitution( - [FindPackageShare("bringup"), "config", "controller_switcher.yaml"] + [FindPackageShare(runtime_config_package), "config", "controller_switcher.yaml"] ) # -- Additional Configuration Setup -- diff --git a/src/subsystems/science/science_bringup/launch/athena_science.launch.py b/src/subsystems/science/science_bringup/launch/athena_science.launch.py index 1d968135..f6fae2a1 100644 --- a/src/subsystems/science/science_bringup/launch/athena_science.launch.py +++ b/src/subsystems/science/science_bringup/launch/athena_science.launch.py @@ -145,7 +145,7 @@ def generate_launch_description(): ) controller_switcher_config = PathJoinSubstitution( - [FindPackageShare("bringup"), "config", "controller_switcher.yaml"] + [FindPackageShare(runtime_config_package), "config", "controller_switcher.yaml"] ) joystick_config_file = PathJoinSubstitution(