当程序有许多参数传入时,通常会通过rosparm进行传递, 传递形式为在roslaunch文件中的node中,使用rosparm,比如 <node pkg="tvio" type="image_processor_node" name="image_processor" output="screen" > <rosparam command="load" file="$(arg calibration_file)"/> <param name="grid_row" value="4"/> <param name="grid_col" value="5"/> <remap from="~imu" to="/xsens_imu_data"/> <remap from="~cam0_image" to="/camera/left/image_raw"/> <remap from="~cam1_image" to="/camera/right/image_raw"/> </node> 其中,calibration_file为指定的rosparam格式的yaml文件。 可以通过launch文件启动调试,但是不是很习惯,还是喜欢用Clion的可视化调试。 方法: 1)在终端中手动加载rosparam参数: python /opt/ros/kinetic/bin/rosparam load /xxxx/camchain.yaml 参数一旦加载后,会保持在本机上的参数服务器中(是不是和roscore相关),程序运行就能读取到。 2)remap中的参数项通过程序的命令行参数形式传入: image_processor ~imu:=/xsens_imu_data...
Comments
Post a Comment