wmy15729 2021-06-28 17:44 采纳率: 0%
浏览 56

moveit motion planning, moveit包怎样配置?

我想要用moveit 配置motion planning,中间遇到问题。

在Moveit setup assistant生成文件以后试图修改moveit_rviz.launch文件,代码如下:

<launch>

  <arg name="debug" default="false" />
  <arg unless="$(arg debug)" name="launch_prefix" value="" />
  <arg     if="$(arg debug)" name="launch_prefix" value="gdb --ex run --args" />

  <arg name="config" default="false" />
  <arg unless="$(arg config)" name="launch_prefix" value="" />
  
 

  <node name="$(anon rviz)" launch-prefix="$(arg launch_prefix)" pkg="rviz" type="rviz" respawn="false"
        args="$(arg command_args)" output="screen">
  </node>

</launch>

错误显示:

RLException: [moveit_rviz.launch] requires the 'command_args' arg to be set
The traceback for the exception was written to the log file

 

推测是中间arg config那段编写错误。楼主不知道怎样修改,参考了各种资料出错都不一样,望急求解答,谢谢各位大神帮助!

 

我用的ubuntu 18.04, ROS melodic版本。

  • 写回答

1条回答 默认 最新

  • 凯冰 优质创作者: 编程框架技术领域 2024-03-06 01:11
    关注

    根据错误信息,问题在于没有设置 command_args 参数。 command_args 参数用于指定传递给 rviz 节点的命令行参数。在你的代码中, rviz 节点的参数设置如下:
     

     

    其中, args="$(arg command_args)" 表示将 command_args 参数的值传递给 rviz 节点。但是,在你的 launch 文件中,并没有设置 command_args 参数的值。

    要解决这个问题,你需要在 launch 文件中设置 command_args 参数的值。例如,如果你想在启动 rviz 节点时显示 URDF 模型,可以将 command_args 参数设置为 -d $(find urdf_model)/urdf/model.urdf ,其中 $(find urdf_model)/urdf/model.urdf 是 URDF 模型的路径。

    以下是一个修改后的 launch 文件示例:







     

    在上述代码中,将 args="-d $(find urdf_model)/urdf/model.urdf" 添加到 rviz 节点的参数中,用于指定显示的 URDF 模型。你需要将 $(find urdf_model)/urdf/model.urdf 替换为你的 URDF 模型的实际路径。

    评论

报告相同问题?