在arbotix模拟器中运行自己的Robot

在arbotix模拟器中运行自己的Robot

一、建立自己Robot的URDF文件

1.如果你有一个自己的URDF机器人模型,您可以在Arbotix模拟器运行它。如果没有就自己建立一个。

2.首先复制fake_turtlebot.launch文件

$ roscd rbx1_bringup/launch
$ cp fake_turtlebot.launch fake_my_robot.launch

3.在你最喜欢的编辑器中打开您的启动文件fake_my_robot.launch。首先,它会像这样:

<launch>
<param name="/use_sim_time" value="false" />
<!-- Load the URDF/Xacro model of our robot -->
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find
rbx1_description)/urdf/turtlebot.urdf.xacro'" />
<param name="robot_description" command="$(arg urdf_file)" />
<node name="arbotix" pkg="arbotix_python" type="arbotix_driver"
output="screen">
<rosparam file="$(find rbx1_bringup)/config/fake_turtlebot_arbotix.yaml"
command="load" />
<param name="sim" value="true"/>
</node>
<node name="robot_state_publisher" pkg="robot_state_publisher"
type="state_publisher">
<param name="publish_frequency" type="double" value="20.0" />
</node>
</launch>

4.如您所见,URDF模型的加载是代码的顶部那里。如果你想使用自己的URDF,只需要简单的替换包和路径名指向自己的URDF / Xacro文件。就像下面这样:

<launch>
<!-- Load the URDF/Xacro model of our robot -->
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find
YOUR_PACKAGE_NAME)/YOUR_URDF_PATH'" />
<param name="robot_description" command="$(arg urdf_file)" />
<node name="arbotix" pkg="arbotix_python" type="arbotix_driver"
output="screen">
<rosparam file="$(find rbx1_bringup)/config/fake_turtlebot_arbotix.yaml"
command="load" />
<param name="sim" value="true"/>
</node>
<node name="robot_state_publisher" pkg="robot_state_publisher"
type="state_publisher">
<param name="publish_frequency" type="double" value="20.0" />
</node>
</launch>

5.最后将launch文件按我上篇文章的所述运行就可以了。运行效果如下:
这里写图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Forrest-Z

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值