I would like to build a system, which starts the matching Nodes with correct parameters depending to the vehicle type. The vehicle type I get via the CAN Interface.
My idea was to have a python launch file which first starts the CAN Node which will get the vehicle type and after I got the type I want to launch the matching Nodes with parameters for exactly this type.
So currently I'm struggling to get the feedback from the Node inside the launch script. Does anyone have an idea on how to handle this?
Best regards
Andy
What you are trying to achieve inside the launch file can be better managed by defining a Vehicle Node Class which parameters are obtained from a topic published by the CAN Node.
An alternative solution using launch file could be to set parameters from the CAN Node while waiting to spawn the Vehicle Node.
Ideally you would:
start your CAN Node using a launch file and an eventHandler to wait for it to print something.
set the "Vehicle_type" parameter using rclcpp/rclpy and print something.
get in the launch file the parameter using substitutions.