.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
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
)