How can I load a yaml rosparam file for a nodelet?
Usually, when writing a launch file and wanting to set many rosparam
s at once, one would place them in a YAML file which is then loaded for the node like this:
<node
name="$(arg node_name)"
pkg="pylon_camera"
type="pylon_camera_node"
output="screen"
respawn="$(arg respawn)"
launch-prefix="$(arg launch_prefix)" >
<param name="camera_frame" value="$(arg node_name)" type="string" />
<rosparam command="load" file="$(arg config_file)" />
</node>
Now, the same does not seem to work in a nodelet.
<node if="$(arg start_pylon_driver)"
pkg="nodelet"
type="nodelet"
name="PylonNodelet"
args="load pylon_camera/PylonNodelet $(arg manager_name)"
output="screen"
respawn="false">
<param name="camera_frame" value="pylon_camera" type="string" />
<rosparam command="load" file="$(arg config_file)" />
</node>
The nodelet loads and runs, but the parameters are all default values, not the ones set in the config.yaml
.
How can this be accomplished?
What pylon_camera is this? https://github.com/magazino/pylon_camera doesn't support nodelets.
What do you mean it doesn't support nodelets? I simply made the required additions to the codebase, it's basically as simple as writing a nodelet subclass which does what
main.cpp
does otherwise. The nodelet is working alright, it just doesn't respect the config params.