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" />
 
 <include file="$(find rplidar_ros)/launch/rplidar.launch" />

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

 
 <include file="$(find turn_on_wheeltec_robot)/launch/include/amcl_omni.launch" />

 
 
 
 <include file="$(find turn_on_wheeltec_robot)/launch/include/dwa_local_planner.launch" /> 

 
 <node name='send_mark' pkg="turn_on_wheeltec_robot" type="send_mark.py">
 node>

launch>