robotoperatingsystem(ros)学习笔记2---使用smartcar进行仿真

林先森_007 林先森_007     2022-08-30     338

关键词:

搭建环境:XMWare  Ubuntu14.04  ROS(indigo)

转载自古月居  转载连接:http://www.guyuehome.com/248

 

一、模型完善

  文件夹urdf下,创建gazebo.urdf.xacro、smartcar.urdf.xacro、smartcar_body.urdf.xacro三个文件

1、机器人主体smartcar_body.urdf.xacro文件

 

  1 <?xml version="1.0"?>  
  2 <robot name="smartcar" xmlns:xacro="http://ros.org/wiki/xacro">  
  3   <property name="M_PI" value="3.14159"/>  
  4  
  5   <!-- Macro for SmartCar body. Including Gazebo extensions, but does not include Kinect -->  
  6   <include filename="$(find smartcar_description)/urdf/gazebo.urdf.xacro"/>  
  7  
  8   <property name="base_x" value="0.33" />  
  9   <property name="base_y" value="0.33" />  
 10  
 11   <xacro:macro name="smartcar_body">  
 12  
 13  
 14     <link name="base_link">  
 15     <inertial>  
 16       <origin xyz="0 0 0.055"/>  
 17       <mass value="1.0" />  
 18       <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
 19     </inertial>  
 20     <visual>  
 21       <geometry>  
 22         <box size="0.25 .16 .05"/>  
 23       </geometry>  
 24       <origin rpy="0 0 0" xyz="0 0 0.055"/>  
 25       <material name="blue">  
 26       <color rgba="0 0 .8 1"/>  
 27       </material>  
 28    </visual>  
 29    <collision>  
 30       <origin rpy="0 0 0" xyz="0 0 0.055"/>  
 31       <geometry>  
 32         <box size="0.25 .16 .05" />  
 33       </geometry>  
 34     </collision>  
 35   </link>  
 36  
 37  
 38  <link name="left_front_wheel">  
 39     <inertial>  
 40       <origin  xyz="0.08 0.08 0.025"/>  
 41       <mass value="0.1" />  
 42        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
 43     </inertial>  
 44     <visual>  
 45       <geometry>  
 46         <cylinder length=".02" radius="0.025"/>  
 47       </geometry>  
 48       <material name="black">  
 49         <color rgba="0 0 0 1"/>  
 50       </material>  
 51     </visual>  
 52     <collision>  
 53       <origin rpy="0 1.57075 1.57075" xyz="0.08 0.08 0.025"/>  
 54       <geometry>  
 55          <cylinder length=".02" radius="0.025"/>  
 56       </geometry>  
 57     </collision>  
 58   </link>  
 59  
 60   <joint name="left_front_wheel_joint" type="continuous">  
 61     <axis xyz="0 0 1"/>  
 62     <parent link="base_link"/>  
 63     <child link="left_front_wheel"/>  
 64     <origin rpy="0 1.57075 1.57075" xyz="0.08 0.08 0.025"/>  
 65     <limit effort="100" velocity="100"/>  
 66     <joint_properties damping="0.0" friction="0.0"/>  
 67   </joint>  
 68  
 69   <link name="right_front_wheel">  
 70     <inertial>  
 71       <origin xyz="0.08 -0.08 0.025"/>  
 72       <mass value="0.1" />  
 73        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
 74     </inertial>  
 75     <visual>  
 76       <geometry>  
 77         <cylinder length=".02" radius="0.025"/>  
 78       </geometry>  
 79       <material name="black">  
 80         <color rgba="0 0 0 1"/>  
 81       </material>  
 82     </visual>  
 83     <collision>  
 84       <origin rpy="0 1.57075 1.57075" xyz="0.08 -0.08 0.025"/>  
 85       <geometry>  
 86          <cylinder length=".02" radius="0.025"/>  
 87       </geometry>  
 88     </collision>  
 89   </link>  
 90  
 91   <joint name="right_front_wheel_joint" type="continuous">  
 92     <axis xyz="0 0 1"/>  
 93     <parent link="base_link"/>  
 94     <child link="right_front_wheel"/>  
 95     <origin rpy="0 1.57075 1.57075" xyz="0.08 -0.08 0.025"/>  
 96     <limit effort="100" velocity="100"/>  
 97     <joint_properties damping="0.0" friction="0.0"/>  
 98  </joint>  
 99  
100  <link name="left_back_wheel">  
101     <inertial>  
102       <origin xyz="-0.08 0.08 0.025"/>  
103       <mass value="0.1" />  
104        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
105     </inertial>  
106     <visual>  
107       <geometry>  
108         <cylinder length=".02" radius="0.025"/>  
109       </geometry>  
110       <material name="black">  
111         <color rgba="0 0 0 1"/>  
112       </material>  
113    </visual>  
114    <collision>  
115        <origin rpy="0 1.57075 1.57075" xyz="-0.08 0.08 0.025"/>  
116       <geometry>  
117          <cylinder length=".02" radius="0.025"/>  
118       </geometry>  
119     </collision>  
120   </link>  
121  
122   <joint name="left_back_wheel_joint" type="continuous">  
123     <axis xyz="0 0 1"/>  
124     <parent link="base_link"/>  
125     <child link="left_back_wheel"/>  
126     <origin rpy="0 1.57075 1.57075" xyz="-0.08 0.08 0.025"/>  
127     <limit effort="100" velocity="100"/>  
128     <joint_properties damping="0.0" friction="0.0"/>  
129   </joint>  
130  
131   <link name="right_back_wheel">  
132     <inertial>  
133        <origin xyz="-0.08 -0.08 0.025"/>  
134        <mass value="0.1" />  
135        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
136     </inertial>  
137     <visual>  
138       <geometry>  
139         <cylinder length=".02" radius="0.025"/>  
140       </geometry>  
141       <material name="black">  
142         <color rgba="0 0 0 1"/>  
143       </material>  
144    </visual>  
145    <collision>  
146       <origin rpy="0 1.57075 1.57075" xyz="-0.08 -0.08 0.025"/>  
147       <geometry>  
148          <cylinder length=".02" radius="0.025"/>  
149       </geometry>  
150     </collision>  
151   </link>  
152  
153  
154   <joint name="right_back_wheel_joint" type="continuous">  
155     <axis xyz="0 0 1"/>  
156     <parent link="base_link"/>  
157     <child link="right_back_wheel"/>  
158     <origin rpy="0 1.57075 1.57075" xyz="-0.08 -0.08 0.025"/>  
159     <limit effort="100" velocity="100"/>  
160     <joint_properties damping="0.0" friction="0.0"/>  
161   </joint>  
162  
163   <link name="head">  
164     <inertial>  
165       <origin xyz="0.08 0 0.08"/>  
166       <mass value="0.1" />  
167       <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>  
168     </inertial>  
169     <visual>  
170       <geometry>  
171         <box size=".02 .03 .03"/>  
172       </geometry>  
173       <material name="white">  
174         <color rgba="1 1 1 1"/>  
175       </material>  
176      </visual>  
177      <collision>  
178       <origin xyz="0.08 0 0.08"/>  
179       <geometry>  
180          <cylinder length=".02" radius="0.025"/>  
181       </geometry>  
182     </collision>  
183   </link>  
184  
185   <joint name="tobox" type="fixed">  
186     <parent link="base_link"/>  
187     <child link="head"/>  
188     <origin xyz="0.08 0 0.08"/>  
189   </joint>  
190   </xacro:macro>  
191  
192 </robot>

 

2、gazebo属性部分gazebo.urdf.xacro

 1 <?xml version="1.0"?>  
 2  
 3 <robot xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"   
 4     xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"   
 5     xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"   
 6     xmlns:xacro="http://ros.org/wiki/xacro"   
 7     name="smartcar_gazebo">  
 8  
 9 <!-- ASUS Xtion PRO camera for simulation -->  
10 <!-- gazebo_ros_wge100 plugin is in kt2_gazebo_plugins package -->  
11 <xacro:macro name="smartcar_sim">  
12     <gazebo reference="base_link">  
13         <material>Gazebo/Blue</material>  
14     </gazebo>  
15  
16     <gazebo reference="right_front_wheel">  
17         <material>Gazebo/FlatBlack</material>  
18     </gazebo>  
19  
20     <gazebo reference="right_back_wheel">  
21         <material>Gazebo/FlatBlack</material>  
22     </gazebo>  
23  
24     <gazebo reference="left_front_wheel">  
25         <material>Gazebo/FlatBlack</material>  
26     </gazebo>  
27  
28     <gazebo reference="left_back_wheel">  
29         <material>Gazebo/FlatBlack</material>  
30     </gazebo>  
31  
32     <gazebo reference="head">  
33         <material>Gazebo/White</查看详情  

robotoperatingsystem(ros)学习笔记2---使用smartcar进行仿真

搭建环境:XMWare Ubuntu14.04 ROS(indigo)转载自古月居 转载连接:http://www.guyuehome.com/248 一、模型完善  文件夹urdf下,创建gazebo.urdf.xacro、smartcar.urdf.xacro、smartcar_body.urdf.xacro三个文件1、机器人主体smartcar_bod 查看详情

robotoperatingsystem(ros)学习笔记---创建简单的机器人模型smartcar

搭建环境:XMWare Ubuntu14.04 ROS(indigo)转载自古月居 转载连接:http://www.guyuehome.com/243一、创建硬件描述包已创建catkin_ws打开终端(Ctrl+Alt+T)输入:cd~/catkin_ws/src输入:catkin_create_pkgsmartcar_descriptionurdf(indigo版) 查看详情

ros概述

...《ROS探索总结》《ROS·wiki:Introduction》入门介绍ROS(RobotOperatingSystem)是一个机器人软件平台,它能为异质计算机集群提供类似操作系统的功能。ROS系统是起源于2007年斯坦福大学人工智能实验室的项目与机器人技术公司WillowGa... 查看详情

roboticssystemtoolbox笔记

1、ROS基本概念ROS全称为RobotOperatingSystem,是一种采用分布式架构的元操作系统,它本身并不是通常意义上的操作系统,可以简单的将它理解为是在多个物理计算机中运行的众多ROS节点形成的一个ROS网络。 ROS的基本概念ROS网络... 查看详情

ros探索总结——ros简介

...求。2010年WillowGarage公司发布了开源机器人操作系统ROS(robotoperatingsystem),很快在机器人研究领域展开了学习和使用ROS的热潮。&nbs 查看详情

ros1.0indigo版本安装步骤

...上略作修改。在此特向原作者“小萌是个球”致谢。ROS(RobotOperatingSystem)翻译过来叫机器人操作系统,官方定义如下:ROS是面向机器人的开源的元操作系统(meta-operatingsystem)。它能够提供类似传统操作系统的诸多功能,如硬... 查看详情

创建一个移动标记。机器人操作系统(ROS)

...。机器人操作系统(ROS)【英文标题】:Createamovingmarker.RobotOperatingSystem(ROS)【发布时间】:2018-10-3017:46:20【问题描述】:我正在尝试使用OSM数据在ROS中规划路线,并使用Python在Rviz中显示结果。到现在为止,我的结果如下:由Rviz... 查看详情

ros机器人操作系统:概述

ROS是RobotOperatingSystem的缩写,通常称为“机器人操作系统”。但它并不是一个真正的操作系统,而是一个面向机器人的开源的元操作系统(meta-operatingsystem),提供类似传统操作系统的诸多功能:硬件抽象... 查看详情

ros机器人操作系统:概述

ROS是RobotOperatingSystem的缩写,通常称为“机器人操作系统”。但它并不是一个真正的操作系统,而是一个面向机器人的开源的元操作系统(meta-operatingsystem),提供类似传统操作系统的诸多功能:硬件抽象... 查看详情

2017.10.13ros机器人操作系统ros系统常用术语及资源

...,提供了类似于软件开发中使用到的中间件的功能。ROS:RobotOperatingSystem 机器人操作系统Package: 功能包Stack: 功能包集Message: 消息Service: 服务Topic: 话题Node: 节点Master: 节点管理器Parameter&nb 查看详情

机器人操作系统(ROS),ROSOUT泄漏文件描述符

...人操作系统(ROS),ROSOUT泄漏文件描述符【英文标题】:RobotOperatingSystem(ROS),ROSOUTleakfiledescriptors【发布时间】:2016-12-1912:13:24【问题描述】:为什么rosout节点要花费一千多个文件描述符。lsof-p&lt;pidofrosout&gt;,近千个FD“无... 查看详情

rosonarm--rk3066上本地编译rosgroovy(代码片段)

1.开源机器人操作系统ROS(RobotOperatingSystem)简介ROS(RobotOperatingSystem)是一个开源的为机器人软件开发设计的软件框架,在异构计算机集群中提供类似操作系统的功能。它并不是一个计算机的操作系统,而是机器人... 查看详情

ros从入门到精通系列(二十八)--ros控制器图形化界面开发

ROS(RobotOperatingSystem,机器人操作系统)作为机器人软件中的通信及控制中间件,提供一系列程序库和工具以帮助软件开发者创建机器人应用软件。它提供了硬件抽象、设备驱动、函数库、可视化工具、消息传递和软件包管理等诸多... 查看详情

ros2机器人操作系统入门和安装以及如何使用.net进行开发(代码片段)

...emo和如何使用.NET接入的其中一种方式。什么是ROSROS(RobotOperatingSystemÿ 查看详情

rostf编程指南(代码片段)

ROS(RobotOperatingSystem,机器人操作系统)是最知名的机器人操作系统,广泛应用于无人驾驶和机器人,tf(transforms,坐标系转换)是ROS下的一个常用的工具库。roswiki下给出了一个清晰的tutorial,然而,tftutorial为了给出清晰的示例相对... 查看详情

澳五机器人

澳五机器人软件简介wx1203296909ROS(RobotOperatingSystem,机器人操作系统)提供一系列程序库和工具以帮助软件开发者创建机器人应用软件。它提供了硬件抽象、设备驱动、库函数、可视化、消息传递和软件包管理等诸多功能。ROS遵守BSD... 查看详情

机器人操作系统ros--简介(一)

参考技术A网址:http://www.ros.org/ROS(机器人操作系统,RobotOperatingSystem),是专为机器人软件开发所设计出来的一套电脑[操作系统]架构。它是一个开源的元级操作系统(后操作系统),提供类似于操作系统的服务,包括硬件抽象... 查看详情