赞
踩
基于Promethues根据wiki配置好之后可以实现使用终端控制,起飞;降落;前后左右飞行;上升下降左转右转;
开始我基于仿真测试实机不成功,是因为某个运行节点没有打开,仔细看gazebo.launch文件里仿真部分还加载了一个sitl.launch文件,它里面启动了相关节点。
终端1:make px4_sitl gazebo
终端2:roslaunch my_px4.launch
修改mavros的fcu_url为/dev/ttyTHS1,然后运行
sudo chmod 777 /dev/ttyTHS1
roslaunch my_px4.launch
- <launch>
- <!-- 启动MAVROS -->
- <!-- 不同机载电脑,注意修改fcu_url至正确的端口号及波特率 -->
- <node pkg="mavros" type="mavros_node" name="mavros" output="screen">
- <!-- 与飞控连接方式,需要配置 -->
- <param name="fcu_url" value="udp://:14540@127.0.0.1:14557" />
- <param name="gcs_url" value="" />
- <param name="target_system_id" value="1" />
- <param name="target_component_id" value="1" />
- <rosparam command="load" file="$(find prometheus_experiment)/config/mavros_config/px4_pluginlists.yaml" />
- <rosparam command="load" file="$(find prometheus_experiment)/config/mavros_config/px4_config.yaml" />
- </node>
-
- <!-- Spawn vehicle model -->
- <!-- https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_ros/scripts/spawn_model -->
- <!-- 初始位置 -->
- <arg name="x" default="0.0"/>
- <arg name="y" default="0.0"/>
- <arg name="z" default="0.2"/>
- <arg name="R" default="0.0"/>
- <arg name="P" default="0.0"/>
- <arg name="Y" default="0.0"/>
-
- <!-- TF transform -->
- <include file="$(find prometheus_gazebo)/launch_basic/tf_transform.launch">
- <arg name="x" value="$(arg x)"/>
- <arg name="y" value="$(arg y)"/>
- <arg name="z" value="$(arg z)"/>
- </include>
-
- <!-- 启动Prometheus代码 -->
- <!-- run the px4_pos_estimator.cpp -->
- <arg name="input_source" default="2"/>
- <arg name="rate_hz" default="30"/>
- <node pkg="prometheus_control" type="px4_pos_estimator" name="px4_pos_estimator" output="screen">
- <!-- 定位数据输入源 0 for vicon, 1 for 激光SLAM, 2 for gazebo ground truth, 3 for T265 -->
- <param name="input_source" value="$(arg input_source)" />
- <param name="rate_hz" value="$(arg rate_hz)" />
- <param name="offset_x" value="$(arg x)" />
- <param name="offset_y" value="$(arg y)" />
- <param name="offset_z" value="$(arg z)" />
- </node>
-
- <node pkg="prometheus_control" type="px4_sender" name="px4_sender" output="screen">
- <rosparam command="load" file="$(find prometheus_gazebo)/config/prometheus_control_config/px4_sender.yaml"/>
- </node>
-
- <!-- run the ground_station.cpp -->
- <node pkg="prometheus_station" type="ground_station" name="ground_station" output="screen" launch-prefix="gnome-terminal --tab --">
- </node>
-
- <!-- run the ground_station_msg.cpp -->
- <node pkg="prometheus_station" type="ground_station_msg" name="ground_station_msg" output="screen" launch-prefix="gnome-terminal --tab --">
- </node>
-
- <!-- run the terminal_control.cpp -->
- <node pkg="prometheus_control" type="terminal_control" name="terminal_control" output="screen" launch-prefix="gnome-terminal --">
- <rosparam command="load" file="$(find prometheus_gazebo)/config/prometheus_control_config/terminal_control.yaml" />
- </node>
-
- </launch>
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。