启动基本命令
sudo chmod 777 /dev/ttyACM0 //开启飞控串口
source /home/yanchang/Fast-Drone-250/devel/setup.bash
cd /home/yanchang/Fast-Drone-250 //加载命令行终端环境
sh shfiles/rspx4.sh
roslaunch ego_planner single_run_in_exp.launch //真实飞机
roslaunch ego_planner single_run_in_sim.launch //模拟环境
sh shfiles/record.sh
roslaunch ego_planner rviz.launch
rosrun ego_planner TestPyNode.py命令行监听模拟rviz发送数据
yanchang@yanchang-MiNiPc:~/Fast-Drone-250$ rostopic echo /move_base_simple/goal
header:
seq: 0
stamp:
secs: 1744791289
nsecs: 164873758
frame_id: "world"
pose:
position:
x: 2.404064178466797
y: -4.245367527008057
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
---然后可以通过命令行模拟此话题的输出
rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped \
"{
header: {
seq: 0, # 可选字段(ROS1会自动填充,可省略)
stamp: {secs: 0, nsecs: 0}, # 关键修复:secs/nsecs替换sec/nsec
frame_id: 'world'
},
pose: {
position: {x: 3.0, y: 9.0, z: 1.0},
orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}
}
}" \
--once