Conversation
| LaserResender() | ||
| : rclcpp_lifecycle::LifecycleNode("laser_resender") | ||
| { | ||
| declare_parameter("node_name"); |
There was a problem hiding this comment.
What is the intention of this node_name here? Could be a better id
There was a problem hiding this comment.
Following the Arne suggestions in micro-ROS/system_modes#45 (comment) I have defined a fake parameter.
Currently, there has to be a parameter, because otherwise the mode is invisible from the outside and can't be inferred in any way.
You may want to introduce a simple fake parameter, that is a bool for example or - to make it a bit easier to understand - a string parameter that holds the name of the mode. We stumbled upon this question before.
| while not cli.wait_for_service(timeout_sec=1.0): | ||
| print('service not available, waiting again...') | ||
| req = ChangeMode.Request() | ||
| req.node_name = node_name |
There was a problem hiding this comment.
This causes an error with newer versions of system_modes:
ros2 run metacontroller_pilot metacontroller
Traceback (most recent call last):
File "/home/parallels/pilot_urjc_ws/install/metacontroller_pilot/lib/metacontroller_pilot/metacontroller", line 11, in <module>
load_entry_point('metacontroller-pilot', 'console_scripts', 'metacontroller')()
File "/home/parallels/pilot_urjc_ws/build/metacontroller_pilot/metacontroller_pilot/metacontroller_sim.py", line 67, in main
node.change_mode("pilot", '__DEFAULT__')
File "/home/parallels/pilot_urjc_ws/build/metacontroller_pilot/metacontroller_pilot/metacontroller_sim.py", line 47, in change_mode
req.node_name = node_name
AttributeError: 'ChangeMode_Request' object has no attribute 'node_name'| req.node_name = node_name |
There was a problem hiding this comment.
I am using the feature/rules branch, and this field is necessary. I have changed the dependencies.repos file to download this branch instead of master
|
I have added the changes to solve these issues in #51 |
System modes inference
Please, accept first my previous PR #48
This PR adds the rules to the pilot_modes to support the inference and adaptation of the system_modes:
I have tested adaptation of the system_modes in case of laser failure.
I have modified the dummy metacontroller to read the logs of the battery and change the mode to ENERGY_SAVING.
Future works