ROS學習筆記(8)——單點導航——手動發布目標點


手動發布目標點

命令

rostopic pub /move_base_simple/goal

Tab鍵補全數據格式

rostopic pub /move_base_simple/goal gemetry_msgs/PoseStamped

Tab鍵補全數據內容

rostopic pub /move_base_simple/goal gemetry_msgs/PoseStamped "header:
  seq: 0
  stamp:: 0
    secs: 00
    nsecs: 0' '
  frame_id: ' '
pose:ition:
  position:
    x: 0.0
    y: 0.0
z: 0.0ion:
orientation:
x: 0.0
y: 0.0"
z: 0.0
w: 0.0"

需要輸入數據內容

frame_id: 'map'

#以map為原點

position

他的x,y,z代表移動距離,單位m。z默認不移動為0

orientation:四元數

w =cos(theta/2)

x=ax *sin(theta/2)

y = ay * sin(theta/2)

Z=az *sin(theta/2)

其中(ax,ay,az)表示軸的矢量,theta表示繞此軸的旋轉角度,小車X,Y不用設置,默認為0。az默認為1,設置theta即可(逆時針方向為正)。

navigation.launch

代碼

<launch>
 <!-- 開啟機器人底層相關節點  -->
 <include file="$(find turn_on_wheeltec_robot)/launch/turn_on_wheeltec_robot.launch" />
 <!-- turn on lidar開啟思嵐雷達  -->
 <include file="$(find rplidar_ros)/launch/rplidar.launch" />

 <!-- 設置需要用於導航的地圖 .yaml可以更換地圖  -->
 <arg name="map_file" default="$(find turn_on_wheeltec_robot)/map/keting.yaml"/>
 <node name="map_server_for_test" pkg="map_server" type="map_server" args="$(arg map_file)">
 </node>

 <!-- 開啟用於導航的自適應蒙特卡洛定位amcl_omni  運動方式是omni-->
 <include file="$(find turn_on_wheeltec_robot)/launch/include/amcl_omni.launch" />

 <!-- 開啟teb_local_planner導航算法-一般用於全向移動阿克曼等車-->
 <!-- <include file="$(find turn_on_wheeltec_robot)/launch/include/teb_local_planner.launch" />-->
 <!-- 開啟dwa_local_planner導航算法-一般用於差速車-->
 <include file="$(find turn_on_wheeltec_robot)/launch/include/dwa_local_planner.launch" /> 

 <!-- MarkerArray功能節點> -->
 <node name='send_mark' pkg="turn_on_wheeltec_robot" type="send_mark.py">
 </node>

</launch>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM