概述
实践内容:
1、运用urdf建模
实现案例中的机器人。
2、根据以上掌握的方法,再快速创建一个机器人模型。
成果图:
![9125154-5f2a85b2a2c84c08.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-5f2a85b2a2c84c08.png)
成果图
创建需要用到的功能包以及各种文件夹:
![9125154-0489860f0269bd6a.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-0489860f0269bd6a.png)
![9125154-5ad5b5fe9bedd0f3.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-5ad5b5fe9bedd0f3.png)
Build跟devel两个文件夹在catkin_make之后会自动生成:
![9125154-0e737dd9e9ae7c2e.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-0e737dd9e9ae7c2e.png)
编写launch文件:
![9125154-3abfb347117f60f4.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-3abfb347117f60f4.png)
添加左轮:
![9125154-69018e4ffb65d539.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-69018e4ffb65d539.png)
编译:
![9125154-03874cc24a381f07.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-03874cc24a381f07.png)
启动:
roslaunch mbot_description display_mbot_base_urdf.launch
![9125154-d9530df46bf14ae2.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-d9530df46bf14ae2.png)
效果:
(当然打开之后需要进行下面一番骚操作先——设置好RobotModel)
![9125154-726100494cd9b25a.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-726100494cd9b25a.png)
拖动滑动条控制轮子转动:
![9125154-f42f8b3a71643ee2.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-f42f8b3a71643ee2.png)
添加右轮:
![9125154-6a08e57511abe80a.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-6a08e57511abe80a.png)
编译,启动,
![9125154-a7fa8009861e6947.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-a7fa8009861e6947.png)
效果如下:
![9125154-06218eed3fd0ef8d.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-06218eed3fd0ef8d.png)
使用球体创建前后支撑轮:
![9125154-4ae334b6000781a9.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-4ae334b6000781a9.png)
编译,启动,效果如下:
![9125154-47af76849ae9d19a.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-47af76849ae9d19a.png)
创建一个自己的机器人模型:
代码:
<?xml version="1.0"?>
<robot name="mbot">
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<cylinder length="0.06" radius="0.20"/>
</geometry>
<material name="yellow">
<color rgba="1 0.4 0 1"/>
</material>
</visual>
</link>
<joint name="left_wheel_joint" type="continuous">
<origin xyz="0 0.19 -0.05" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="left_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="left_wheel_link">
<visual>
<origin xyz="0 0 0" rpy="1.5707 0 0" />
<geometry>
<cylinder radius="0.03" length = "0.025"/>
</geometry>
<material name="white">
<color rgba="1 1 1 0.9"/>
</material>
</visual>
</link>
<joint name="right_wheel_joint" type="continuous">
<origin xyz="0 -0.19 -0.05" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="right_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="right_wheel_link">
<visual>
<origin xyz="0 0 0" rpy="1.5707 0 0" />
<geometry>
<cylinder radius="0.03" length = "0.025"/>
</geometry>
<material name="white">
<color rgba="1 1 1 0.9"/>
</material>
</visual>
</link>
<joint name="front_caster_joint" type="continuous">
<origin xyz="0.18 0 -0.045" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="front_caster_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="front_caster_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<sphere radius="0.03" />
</geometry>
<material name="black">
<color rgba="0 0 0 0.95"/>
</material>
</visual>
</link>
<joint name="back_caster_joint" type="continuous">
<origin xyz="-0.18 0 -0.045" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="back_caster_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="back_caster_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<sphere radius="0.03" />
</geometry>
<material name="black">
<color rgba="0 0 0 0.95"/>
</material>
</visual>
</link>
</robot>
效果:
![9125154-4a9abf75472cc220.png](https://file2.kaopuke.com:8081/files_image/2023060823/9125154-4a9abf75472cc220.png)
最后
以上就是淡然楼房为你收集整理的ROS_机器人urdf建模仿真实践的全部内容,希望文章能够帮你解决ROS_机器人urdf建模仿真实践所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复