p { margin-bottom: 0.1in; direction: ltr; line-height: 120%; text-align: justify }
a:link { color: rgba(0, 0, 255, 1) }

前面我们使用的是已有的机器人模型进行仿真,这一节我们将建立一个简单的智能车机器人smartcar,为后面建立复杂机器人打下基础。

   
一、创建硬件描述包

01. cd ~/catkin_ws/src

02. catkin_create_pkg  smartcar_description  std_msgs rospy roscpp urdf  (roscreat-pkg为旧版本中的命令,虽然在kinetic中也可以使用,但是还是使用catkin_create_pkg比较好,在书中没有添加std_msgs等依赖项,但是实际所测加上上面的几个依赖项才行。)

p { margin-bottom: 0.1in; direction: ltr; line-height: 120%; text-align: justify }
a:link { color: rgba(0, 0, 255, 1) }

p { margin-bottom: 0.1in; direction: ltr; line-height: 120%; text-align: justify }
a:link { color: rgba(0, 0, 255, 1) }

二、智能车尺寸数据



   
因为建立的是一个非常简单的机器人,所以我们尽量使用简单的元素:使用长方体代替车模,使用圆柱代替车轮,具体尺寸如下:

   
三、建立urdf文件



   
在smartcar_description文件夹下建立urdf文件夹,创建智能车的描述文件.urdf,描述代码如下:

<?xml version="1.0"?>
<robot name="smartcar"> <link name="base_link">
<visual> <geometry>
<box size="0.25 .16 .05"/>
</geometry> <origin rpy="0 0 1.57075" xyz="0 0 0"/>
<material name="blue">
<color rgba="0 0 .8 1.3"/>
</material>
</visual>
</link> <link name="right_front_wheel"> <visual> <geometry>
<cylinder length=".02" radius="0.025"/>
</geometry> <material name="black">
<color rgba="0 0 0 1"/>
</material> </visual>
</link> <joint name="right_front_wheel_joint" type="continuous">
<axis xyz="0 0 1"/>
<parent link="base_link"/>
<child link="right_front_wheel"/>
<origin rpy="0 1.57075 0" xyz="0.08 0.1 -0.03"/>
<limit effort="100" velocity="100"/>
<joint_properties damping="0.0" friction="0.0"/>
</joint> <link name="right_back_wheel">
<visual>
<geometry>
<cylinder length=".02" radius="0.025"/>
</geometry> <material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link> <joint name="right_back_wheel_joint" type="continuous">
<axis xyz="0 0 1"/>
<parent link="base_link"/>
<child link="right_back_wheel"/>
<origin rpy="0 1.57075 0" xyz="0.08 -0.1 -0.03"/>
<limit effort="100" velocity="100"/>
<joint_properties damping="0.0" friction="0.0"/>
</joint> <link name="left_front_wheel"> <visual> <geometry>
<cylinder length=".02" radius="0.025"/>
</geometry>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link> <joint name="left_front_wheel_joint" type="continuous">
<axis xyz="0 0 1"/>
<parent link="base_link"/>
<child link="left_front_wheel"/>
<origin rpy="0 1.57075 0" xyz="-0.08 0.1 -0.03"/>
<limit effort="100" velocity="100"/> <joint_properties damping="0.0" friction="0.0"/>
</joint> <link name="left_back_wheel">
<visual> <geometry> <cylinder length=".02" radius="0.025"/>
</geometry>
<material name="black"> <color rgba="0 0 0 1"/> </material>
</visual>
</link> <joint name="left_back_wheel_joint" type="continuous">
<axis xyz="0 0 1"/>
<parent link="base_link"/>
<child link="left_back_wheel"/>
<origin rpy="0 1.57075 0" xyz="-0.08 -0.1 -0.03"/>
<limit effort="100" velocity="100"/>
<joint_properties damping="0.0" friction="0.0"/>
</joint> <link name="head">
<visual>
<geometry>
<box size=".02 .03 .03"/>
</geometry> <material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
</link> <joint name="tobox" type="fixed">
<parent link="base_link"/>
<child link="head"/>
<origin xyz="0 0.08 0.025"/>
</joint>
</robot>

四、建立launch命令文件

   
在smartcar_description文件夹下建立launch文件夹,创建智能车的描述文件
base.urdf.rviz.launch,描述代码如下:

<launch>
<arg name="model"/>
<arg name="gui" default="False"/>
<param name="robot_description" textfile="$(find smartcar_description)/urdf/smartcar.urdf"/>
<param name="use_gui" value="$(arg gui)"/>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
</node> <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/> <node name="rviz" pkg="rviz" type="rviz" args="-d $(find urdf_tutorial)/rviz/urdf.rviz"/>
</launch>

p { margin-bottom: 0.1in; direction: ltr; line-height: 120%; text-align: justify }
a:link { color: rgba(0, 0, 255, 1) }

五、效果演示

   
在终端中输入显示命令:

01. roslaunch smartcar_description base.urdf.rviz.launch gui:=true

显示效果如下图所示,使用gui中的控制bar可以控制四个轮子单独旋转。

【kinetic】操作系统探索总结(五)创建简单的机器人模型smartcar的更多相关文章

  1. ROS探索总结(五)——创建简单的机器人模型smartcar

    前面我们使用的是已有的机器人模型进行仿真,这一节我们将建立一个简单的智能车机器人smartcar,为后面建立复杂机器人打下基础. 一.创建硬件描述包 roscreat-pkg  smartcar_de ...

  2. 创建简单的机器人模型smartcar

    前面我们使用的是已有的机器人模型进行仿真,这一节我们将建立一个简单的智能车机器人 smartcar,为后面建立复杂机器人打下基础. 一.创建硬件描述包. cd ~/catkin_ws/srcroscr ...

  3. Robot Operating System (ROS)学习笔记---创建简单的机器人模型smartcar

    搭建环境:XMWare  Ubuntu14.04  ROS(indigo) 转载自古月居  转载连接:http://www.guyuehome.com/243 一.创建硬件描述包 已创建catkin_ ...

  4. ROS学习记录(一)————创建简单的机器人模型smartcar

    这是我在古月居上找的(http://www.guyuehome.com/243),但直接运行的话,没办法跑起来,我也是查了好多博客和日志,才实现最后的功能的,所以,记录下来,以备后用吧,也欢迎其他和我 ...

  5. Melodic 使用URDF创建简单的机器人模型

    本人Linux版本:Ubuntu 18.04LTS ROS版本:Melodic URDF代码 <?xml version="1.0" ?> <robot name ...

  6. Android开发艺术探索第五章——理解RemoteViews

    Android开发艺术探索第五章--理解RemoteViews 这门课的重心在于RemoteViews,RemoteViews可以理解为一种远程的View,其实他和远程的Service是一样的,Rem ...

  7. Web Service 的创建简单编码、发布和部署

    最近,老大准备将已有的C/S架构项目中的通信部分做成通用,需要将其支持WebService为以后项目向着B/S架构升级做好铺垫,为此身为屌丝的我去各种百度WebService是个什么卵玩意,然后逐渐搭 ...

  8. javaweb学习总结(二十五)——jsp简单标签开发(一)

    一.简单标签(SimpleTag) 由于传统标签使用三个标签接口来完成不同的功能,显得过于繁琐,不利于标签技术的推广, SUN公司为降低标签技术的学习难度,在JSP 2.0中定义了一个更为简单.便于编 ...

  9. Intellij创建简单Springboot项目

    Intellij创建简单Springboot项目 第一步:选择创建新项目——file-new-project 第二步:选择项目类型——Spring Initializr-next 第三步:输入项目信息 ...

随机推荐

  1. Alpha冲刺-第四次冲刺笔记

    Alpha冲刺-冲刺笔记 这个作业属于哪个课程 https://edu.cnblogs.com/campus/fzzcxy/2018SE2 这个作业要求在哪里 https://edu.cnblogs. ...

  2. 半监督伪标签方法:Feature Space Regularization和Joint-Distance

    原文链接 小样本学习与智能前沿 . 在这个公众号后台回复"200706",即可获得课件电子资源. @ 目录 Abstract I. INTRODUCTION Framework. ...

  3. layui获取弹出层内容

    一. 弹出层: <body class="childrenBody"> <form class="layui-form"> <di ...

  4. 原创题目 白银之春 Problem and Solution

    白银之春 Solution 比赛用题面.题解.标程和数据生成器都挂在 git@github.com:sun123zxy/spring.git 上. Problem 白银之春 (spring.cpp/. ...

  5. buuctf-web-[极客大挑战 2019]BuyFlag 1

    打开网页,然后发现menu中有个buyflag的连接,点进去 如果你想买这个flag ,你必须是来自CUIT的一名学生,还必须回答正确的密码.简单了解,我们查看源码,发现思路 POST方式传入两个参数 ...

  6. java并发编程实战《二十一》无锁工具类

    不安全的累加代码,如下 1 public class Test { 2 long count = 0; 3 void add10K() { 4 int idx = 0; 5 while(idx++ & ...

  7. 第5.4节 Python函数中的变量及作用域

    一.函数中的变量使用规则 函数执行时,使用的全局空间是调用方的全局空间,参数及函数使用的局部变量存储在函数单独的局部名字空间内: 函数的形参在函数中修改了值时,并不影响调用方本身的数据,但如果形参是一 ...

  8. Python中的列表解析和列表推导是一回事吗?

    列表解析和列表推导就是一个意思,只是从英文"list comprehension"翻译过来的不同翻译方法. 列表解析就是通过解析表达式从一个可迭代对象生成一个新的列表的Python ...

  9. vue之keep-alive组件

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. Robot Framework+adb框架自动化测试Android设备案例⑷——L2层关键字

    一.EMMC测试套件 L2层关键字.robot *** Settings *** Resource ../L3公共层.robot *** Keywords *** 一般录影文件列表(EMMC) ${f ...