首先看了wiki上的文档http://wiki.ros.org/stage_ros
介绍:
stageros 是一个2D的机器人模拟器,主要通过.world文件来定义这个仿真世界。包括机器人,lidar,camera和障碍物等等。

Stage在设计中就考虑到了多智能体系统的问题,可以提供对多机器人系统的测试仿真。需要了解的是Stage只提供了真正简单,可计算的廉价的设备模式,而无法非常精密地仿真任何具体的设备终端。

Uasge
rosrun stage_ros stageros [-g runs headless] < world > [standard ROS args]
world : 要加载的.world文件
-g : 如果设置,此选项将以“headless”运行模拟器,不显示任何GUIsgare
还有其他选项:usage/option

上面的的是wiki上说的用法
我自己使用的
rosrun stage_ros stageros < world >
world:要加载的.world文件路径
ex:

$ rosrun stage_ros stageros /opt/ros/kinetic/share/stage_ros/world/willow-erratic.world

stage是ros自带的,所以直接取根目录下能找到对应的功能包
看看效果:
现在可以用

rostopic list

查看下效果
可以看到运行.world文件抛出了cmd_vel话题,那么我们可以订阅相关话题来跑slam导航算法。

那么可以知道ros stage中最重要的是.world文件

.world文件语法:ROS-Stage
World
Stage仿真出的"world"是由"model"组成的,在‘wroldfile’中定义

world
(//the name of the world, as displayed in the window title bar. Defaults to the worldfile file name.name            "[filename of worldfile]"//the length of each simulation update cycle in milliseconds.interval_real   100//the amount of real-world (wall-clock) time the siulator will attempt to spend on each simulation cycle.interval_sim    100//the amount of real-world time between GUI updatesgui_interval    100//specifies the resolution of the underlying bitmap model. Larger values speed up raytracing at the expense of fidelity in collision detection and sensing.resolution      0.0)

Window
模拟器的窗口包含了 菜单栏、状态栏和仿真出的"world"

window
(# gui propertiescenter [0 0]size [700 740]     //窗口大小scale 1.0# model properties do not apply to the gui window
)

Model
仿真出的model有一些基础属性: 位置,大小,速度,颜色,各种传感器的可见性等,一些基础模型是由可以由其他模型对象来实现

model
(pose [0 0 0]           //specify the pose of the model in its parent's coordinate systemsize [1.0 1.0]        //specify the size of the modelorigin [0 0 0]       //specify the position of the object's center, relative to its posevelocity [0 0 0]        //specify the initial velocity of the model. Not that if the model hits an obstacle, its velocity will be set to zero.# body colorcolor "red" # determine how the model appears in various sensorsobstacle_return 1       //if 1, this model can collide with other models that have this property setlaser_return 1      //if 0, this model is not detected by laser sensors. if 1, the model shows up in a laser sensor with normal (0) reflectance. If 2, it shows up with high (1) reflectance.ranger_return 1        //if 1, this model can be detected by ranger sensorsblobfinder_return 1 //if 1, this model can be detected in the blob_finder (depending on its color)fiducial_return 1     //fiducial_return [fiducial_id:int]  if non-zero, this model is detected by fiducialfinder sensors. The value is used as the fiducial ID.gripper_return 0       //iff 1, this model can be gripped by a gripper and can be pushed around by collisions with anything that has a non-zero obstacle_return.audio_return 0     //if 1, this model will be an obstacle to audio and will be used to precalculate the audio paths. warning: don't use this for moving objectsfiducial_key 0# GUI propertiesgui_nose 0       //if 1, draw a nose on the model showing its heading (positive X axis)gui_grid 0        //if 1, draw a scaling grid over the modelgui_boundary 0    //if 1, draw a bounding box around the model, indicating its sizegui_movemask ? //gui_movemask[int]   define how the model can be moved by the mouse in the GUI window# unit square body shapepolygons 1polygon[0].points 4polygon[0].point[0] [0 0]polygon[0].point[1] [0 1]polygon[0].point[2] [1 1]polygon[0].point[3] [1 0]bitmap ""
)

提供了几种模型

1.Postion model
postion model 仿真了一个移动机器人底盘

position(
#position propertise
drive "diff"
velocity[0.0 0.0 0.0 0.0]localization "gps"
localization_origin[<default to model's srart pose>]#odometry error model parameters,only used if localization is set to "odom"
odom_error [0.03 0.03 0.00 0.05]#only used if drive is set to "car"
wheelbase 1.0#[xmin xmax ymin ymax zmin zmax zmin amax ]
velocity_bounds [-1 1 -1 1 -1 1 -90 90 ]
acceleration_bounds [-1 1 -1 1 -1 1 -90 90]#model properties
)

PS: 在1.6.5版本之后,odom这一项被删除类,取而代之的是localization_origin
1.使用“gps”可以得到准确的位置信息,使用odom会产生误差,如果非要使用odom则代码中会使用odom_erro这个向量
2.localization_origin[x y z theta]
3.velocaity [x:< float > y z heading ]
4.velocaity[xmin xmax ymin ymax zmin zmax amin amax] xyz线速度范围,a角速度范围
5.wheelbase 将小车的速度预设为1m/s

2.Ranger传感器模型

ranger
(# ranger propertiesscount 16spose[0] [? ? ?]spose[1] [? ? ?]spose[2] [? ? ?]spose[3] [? ? ?]spose[4] [? ? ?]spose[5] [? ? ?]spose[6] [? ? ?]spose[7] [? ? ?]spose[8] [? ? ?]spose[9] [? ? ?]spose[10] [? ? ?]spose[11] [? ? ?]spose[12] [? ? ?]spose[13] [? ? ?]spose[14] [? ? ?]spose[15] [? ? ?]ssize [0.01 0.03]sview [0.0 5.0 5.0]# model propertieswatts 2.0
)

Note:
The ranger model allows configuration of the pose, size and view parameters of each transducer seperately (using spose[index], ssize[index] and sview[index]). However, most users will set a common size and view (using ssize and sview), and just specify individual transducer poses.

3.Laser Model

laser
(# laser propertiessamples 180    //每次扫描180个样本点range_min 0.0range_max 8.0fov 180.0   //扫描角度# model propertiessize [0.15 0.15]color "blue"watts 17.5 # approximately correct for SICK LMS200
)

定义一个移动机器人跑slam

define kinetic ranger(
sensor(range[0.05 10 ] //激光范围fov 180.0 //角度samples 700 //激光束
)
#generic model properties
color “black”
size [ 0.4 0.4 0.1]
)define block model(
size [0.4 0.4 0.1]
gui_nose 0 //是否有箭头指示
)define turtlebot position model(
pose [0 0 0 0]
odom_error [0.00 0.00 1111 0.02]size [1.3 0.8 0.4]
origin [0.0 0.0 0.0 0.0]
gui_nose 1
drive "onmi"
color "gray"
block(pose [0.7000 0.000 0.000 0.000] color "red")
kinect(pose [ 0.065 0.0 0.3 0.0])
)

花了几天时间还是把ros stage搞明白了

ROS Stage学习相关推荐

  1. ros melodic学习之plugin

    ros melodic学习之plugin 开发环境说明及项目创建 plugin具体步骤 创建功能包 创建基类 创建plugin类 注册插件 编译插件的动态链接库 将插件加入ros 创建pluginli ...

  2. ROS中的roslaunch命令和launch文件(ROS入门学习笔记四)

    ROS中的基本对象和概念学习笔记(ROS入门学习笔记一) ROS中创建工作区和包(ROS入门学习笔记二) ROS功能包中CMakeLists.txt的说明(ROS入门学习笔记三) 1.roslaunc ...

  3. Turtlebot+ROS Stage仿真环境实现MPC轨迹跟踪

    在无人车系统(十一):轨迹跟踪模型预测控制(MPC)原理与python实现[40行代码]中介绍了MPC方法在无人车轨迹跟踪中的应用.以Udacity中的例子作为引子,详细介绍了MPC的原理,无人车的运 ...

  4. ROS wiki系列|通过ROS wiki-tutorials学习服务和参数

    依旧是上一期指路:ROS wiki系列|通过ROS wiki-tutorials学习话题 前面讲了节点和话题,我们接下来讲服务和参数,走你~ 同样甩上我们今天的教程页面链接:Understanding ...

  5. 12.ROS编程学习:ROS常用指令

    目录 rosnode 1.rosnode list--list active nodes 2.rosnode ping--test connectivity to node 3.rosnode inf ...

  6. 13.ROS编程学习:话题发布控制乌龟

    目录 准备工作 c++控制乌龟运动 python控制乌龟运动 参考学习资料:赵虚左的课程+古月的ROS机器人开发实践P56的例程. 准备工作 打开ROS乌龟仿真器 roscore rosrun tur ...

  7. ROS wiki系列|通过ROS wiki-tutorials学习话题

    上一期指路:ROS wiki系列|通过ROS wiki-tutorials学习节点 这一期我们就用ROS wiki中的tutorials来学习ROS中另外一个重要的概念:topic--话题 在前面讲解 ...

  8. Ubuntu16.04 ROS 深度学习_传智播客 智能机器人软件开发 学习路线图出炉!首发优惠!!...

    黑马程序员 微信号:heiniu526 传智播客旗下互联网资讯,学习资源免费分享平台 智能机器人软件工程师学习计划 很多朋友对机器人软件开发和人工智能感兴趣,不知道怎么学习,传智播客武汉校区在今年3月 ...

  9. ROS的学习(七)ROS的话题

    首先需要打开一个终端在里面运行roscore: roscore 再打开一个终端,在里面运行一个turtlesim_node节点: rosrun turtlesim turtlesim_node 打开另 ...

最新文章

  1. 推荐一款常用的IDE插件,越用越喜欢
  2. 网络空间站是计算机,超级病毒或入侵国际空间站生命维持计算机
  3. HTML 学习笔记3
  4. docker-compose部署常用服务
  5. plt绘制1 / (1 + np.exp(-x))
  6. socket 套接字
  7. 使用struts2中默认的拦截器以及自定义拦截器
  8. 指针与指针指向的内容(四)
  9. 带着这篇去通关所有Handler的提问(三)
  10. java reader类子类_java io --- Reader类
  11. Spotfire 筛选器类型修改
  12. Java开发工具(二):Intellij Idea IU-2019.2.3版安装配置简明教程
  13. 只有1kb的清理软件_1kb文件夹快捷方式病毒专杀工具
  14. java发送lrc文件格式_lrc歌词文件格式
  15. 计算机考研难度档,计算机考研院校报考难度排行
  16. 第12课 Altium Designer20(AD20)+VESC6.4实战教程:原理图最后验证(北冥有鱼)
  17. DeepMind爆发史:决定AI高峰的“游戏玩家”|深度学习崛起十年
  18. Fla制作元件导出SWC
  19. eBPF学习仓库bpf_study-996station GitHub鉴赏官
  20. 腾讯CSIG-腾讯云-后台开发-面经(已拿offer)

热门文章

  1. [C++]Inside C++对象模型:第三、四、五章笔记
  2. 微信小程序html文章添加跳转链接,微信小程序跳转外部链接(h5页面)以及数据交互...
  3. matlab实现GPC隐写算法,基于LSB信息隐藏算法的MATLAB实现
  4. 30分钟快速搭建一套私有云平台
  5. computer_network CPT实验
  6. github.com/spf13/viper go viper包介绍
  7. Docker_03_彻底搞懂Dockerfile文件
  8. Froyo(Android2.2)移植到Mips平台经验总结
  9. nobup 与 后台运行命令
  10. CVPR2022《BatchFormer: Learning to Explore Sample Relationships for Robust Representation Learning》