diff --git a/mirte_telemetrix/config/mirte_master_config.yaml b/mirte_telemetrix/config/mirte_master_config.yaml index ffe02ca7..a1ede025 100644 --- a/mirte_telemetrix/config/mirte_master_config.yaml +++ b/mirte_telemetrix/config/mirte_master_config.yaml @@ -5,6 +5,7 @@ device: max_frequency: 50 module: motorservocontroller: + device: mirte type: PCA9685 id: 0x40 # frequency: 1600 diff --git a/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py b/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py index ec99a643..71694374 100755 --- a/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py +++ b/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py @@ -932,6 +932,8 @@ def actuators(loop, board, device): servo = Servo(board, servos[servo]) servers.append(loop.create_task(servo.start())) + if rospy.has_param("/mirte/modules"): + servers += add_modules(rospy.get_param("/mirte/modules")) # Set a raw pin value server = rospy.Service("/mirte/set_pin_value", SetPinValue, handle_set_pin_value) @@ -1036,6 +1038,16 @@ def sensors(loop, board, device): return tasks +def add_modules(modules, device) -> []: + # pca9685 module: + modules = {k: v for k, v in modules.items() if v["device"] == device} + for module in modules: + print(module) + + return [] + + + # Shutdown procedure closing = False