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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Turtlbot仿真之Stage

發布時間:2023/12/14 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Turtlbot仿真之Stage 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

目錄

1、stage介紹

2、啟動turtlebot stage仿真程序

3、turtlebot_in_stage.launch 文件內容

4、設定目標位置,觀看機器人自主導航過程


源碼位于:turtlebot_simulator/turtlebot_stage

1、stage介紹

Stage是Player/Stage項目的一個軟件,是一種用于移動機器人和智能傳感系統研究的仿真工具。

Stage在一個二維的位圖環境下模擬移動機器人、傳感器和障礙物等對象。

Stage在設計中就考慮到了多智能體系統的問題,可以提供對多機器人系統的測試仿真。需要了解的是Stage只提供了真正簡單,可計算的廉價的設備模式,而無法非常精密地仿真任何具體的設備終端。

Stage 還允許你利用目前還沒有的虛擬機器人設備進行實驗。

Stage提供了多種傳感器和執行器,包括聲納,激光掃描測距儀,色斑顯示器,里程計,抓斗,防撞器/觸須器以及移動機器人基坐等。

2、啟動turtlebot stage仿真程序

(indigo版本支持,kinetic版本沒有跑通

打開命令終端,輸入一下命令:

roslaunch turtlebot_stage turtlebot_in_stage.launch

turtlebot_stage 導航仿真分別啟動了以下ros包:

- stage???????????????????????????? 仿真世界環境發布各種TF坐標關系,odom、base_scan等仿真數據

? - map_server???????????????? 地圖服務,加載其提供的仿真世界的地圖

? - move_base????????????????? 導航功能包,接收其他包的數據實現導航功能,調用A*、DWA實現路徑規劃

? - static map??????????????????? 靜態地圖

? - amcl?????????????????????????????? 激光定位程序,通過粒子濾波算法實現機器人的實時定位

? - rviz view?????????????????????? Rviz可視化顯示機器人狀態、傳感器數據、導航路線、costmap、設定導航目標點

?

啟動的窗口包括:

IStage的仿真世界:(相當于真實世界)

II、Rviz環境:(地圖、turtlebot模型、算法運行的數據可視化)

III、左右輪TF連接狀態:

?

3、turtlebot_in_stage.launch 文件內容

?

<!--

? Turtlebot navigation simulation:

? - stage

? - map_server

? - move_base

? - static map

? - amcl

? - rviz view

?-->

<launch>

? <arg name="base"?????? default="$(optenv TURTLEBOT_BASE kobuki)"/>? <!-- create, rhoomba -->

? <arg name="stacks"???? default="$(optenv TURTLEBOT_STACKS hexagons)"/>? <!-- circles, hexagons -->

? <arg name="3d_sensor"? default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>? <!-- kinect, asus_xtion_pro -->

?

? <!-- Name of the map to use (without path nor extension) and initial position -->

? <arg name="map_file"?????? default=" $(env TURTLEBOT_STAGE_MAP_FILE)"/> <!-- robopark_plan -->

? <arg name="world_file"?? ??default=" $(env TURTLEBOT_STAGE_WORLD_FILE)"/>

? <arg name="initial_pose_x" default="2.0"/>

? <arg name="initial_pose_y" default="2.0"/>

? <arg name="initial_pose_a" default="0.0"/>

?

? <param name="/use_sim_time" value="true"/>

? <!--? ******************** Stage ********************? -->

? <!--

??????? Publishes transforms:

????????? /base_link -> /base_laser

????????? /base_footprint -> /base_link (identity)

????????? /odom -> base_footprint

??????? Publishes topics:

????????? /odom : odometry data from the simulated odometry

????????? /base_scan : laser data from the simulated laser

????????? /base_pose_ground_truth : the ground truth pose

??????? Parameters:

????????? base_watchdog_timeout : time (s) after receiving the last command on cmd_vel before stopping the robot

??????? Args:

????????? -g : run in headless mode.

? -->

? <node pkg="stage_ros" type="stageros" name="stageros" args="$(arg world_file)">

?? ?<param name="base_watchdog_timeout" value="0.5"/>

??? <remap from="odom" to="odom"/>

??? <remap from="base_pose_ground_truth" to="base_pose_ground_truth"/>

??? <remap from="cmd_vel" to="mobile_base/commands/velocity"/>

??? <remap from="base_scan" to="scan"/>

? </node>

?

? <!--? ***************** Robot Model *****************? -->

? <include file="$(find turtlebot_bringup)/launch/includes/robot.launch.xml">

??? <arg name="base" value="$(arg base)" />

??? <arg name="stacks" value="$(arg stacks)" />

??? <arg name="3d_sensor" value="$(arg 3d_sensor)" />

? </include>

? <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">

??? <param name="use_gui" value="true"/>

? </node>

?

? <!-- Command Velocity multiplexer -->

? <node pkg="nodelet" type="nodelet" name="mobile_base_nodelet_manager" args="manager"/>

? <node pkg="nodelet" type="nodelet" name="cmd_vel_mux" args="load yocs_cmd_vel_mux/CmdVelMuxNodelet mobile_base_nodelet_manager">

??? <param name="yaml_cfg_file" value="$(find turtlebot_bringup)/param/mux.yaml"/>

??? <remap from="cmd_vel_mux/output" to="mobile_base/commands/velocity"/>

? </node>

?

? <!--? ************** Navigation? ***************? -->

? <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>

?

? <!--? ****** Maps *****? -->

? <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)">

??? <param name="frame_id" value="/map"/>

? </node>

?

? <include file="$(find turtlebot_navigation)/launch/includes/amcl/amcl.launch.xml">

??? <arg name="scan_topic" value="scan"/>

??? <arg name="use_map_topic" value="true"/>

??? <arg name="initial_pose_x" value="$(arg initial_pose_x)"/>

??? <arg name="initial_pose_y" value="$(arg initial_pose_y)"/>

??? <arg name="initial_pose_a" value="$(arg initial_pose_a)"/>

? </include>

?

? <!--? **************** Visualisation ****************? -->

? <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot_stage)/rviz/robot_navigation.rviz"/>

</launch>

?

4、設定目標位置,觀看機器人自主導航過程

在rviz界面,點擊菜單欄的【2D Nav Goal】 然后在圖書中選擇一個位置點擊鼠標左鍵并拖到鼠標設定方向終點機器人的方向。

會發現機器人自動設定了全局路徑,并啟用DWA算法自動導航到設定的目標位置。

?

?

?

總結

以上是生活随笔為你收集整理的Turtlbot仿真之Stage的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。