日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

ROS Stage学习

發(fā)布時(shí)間:2023/12/14 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ROS Stage学习 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

首先看了wiki上的文檔http://wiki.ros.org/stage_ros
介紹:
stageros 是一個(gè)2D的機(jī)器人模擬器,主要通過(guò).world文件來(lái)定義這個(gè)仿真世界。包括機(jī)器人,lidar,camera和障礙物等等。

Stage在設(shè)計(jì)中就考慮到了多智能體系統(tǒng)的問(wèn)題,可以提供對(duì)多機(jī)器人系統(tǒng)的測(cè)試仿真。需要了解的是Stage只提供了真正簡(jiǎn)單,可計(jì)算的廉價(jià)的設(shè)備模式,而無(wú)法非常精密地仿真任何具體的設(shè)備終端。

Uasge
rosrun stage_ros stageros [-g runs headless] < world > [standard ROS args]
world : 要加載的.world文件
-g : 如果設(shè)置,此選項(xiàng)將以“headless”運(yùn)行模擬器,不顯示任何GUIsgare
還有其他選項(xiàng):usage/option

上面的的是wiki上說(shuō)的用法
我自己使用的
rosrun stage_ros stageros < world >
world:要加載的.world文件路徑
ex:

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

stage是ros自帶的,所以直接取根目錄下能找到對(duì)應(yīng)的功能包
看看效果:
現(xiàn)在可以用

rostopic list

查看下效果
可以看到運(yùn)行.world文件拋出了cmd_vel話題,那么我們可以訂閱相關(guān)話題來(lái)跑slam導(dǎo)航算法。

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

.world文件語(yǔ)法: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
模擬器的窗口包含了 菜單欄、狀態(tài)欄和仿真出的"world"

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

Model
仿真出的model有一些基礎(chǔ)屬性: 位置,大小,速度,顏色,各種傳感器的可見(jiàn)性等,一些基礎(chǔ)模型是由可以由其他模型對(duì)象來(lái)實(shí)現(xiàn)

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 仿真了一個(gè)移動(dòng)機(jī)器人底盤(pán)

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這一項(xiàng)被刪除類(lèi),取而代之的是localization_origin
1.使用“gps”可以得到準(zhǔn)確的位置信息,使用odom會(huì)產(chǎn)生誤差,如果非要使用odom則代碼中會(huì)使用odom_erro這個(gè)向量
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 將小車(chē)的速度預(yù)設(shè)為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個(gè)樣本點(diǎn)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 )

定義一個(gè)移動(dòng)機(jī)器人跑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]) )

花了幾天時(shí)間還是把ros stage搞明白了

總結(jié)

以上是生活随笔為你收集整理的ROS Stage学习的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。