实物是bluerov。固件是ardusub,
上图中右下角蓝usb一端接pixhawk,另外一端接xavier。xavier上运行
$ls /dev/ttyA*
会增加设备/dev/ttyACM0
在xavier端安装好各种mavlink mavproxy 软件包。
$ xargs -a "/home/pcl/mavproxy.param" mavproxy.py
参数文件内容mavproxy.param
--master=/dev/ttyACM0,115200
--load-module='GPSInput,DepthOutput'
--source-system=200
--cmd="set heartbeat 0"
--out udpin:localhost:9000
--out udpbcast:192.168.2.255:14550
--out udpbcast:192.168.2.255:14551
--mav20
--aircraft telemetry
--streamrate -1
在工作站电脑上安装Qgroundcontrol mavros.
launch 文件内容
<launch>
<!-- vim: set ft=xml noet : -->
<!-- example launch script for ArduPilot based FCU's -->
<arg name="fcu_url" default="udp://:14550@" />
<arg name="gcs_url" default="udp://127.0.0.1:14551@127.0.0.1:14552" />
<arg name="tgt_system" default="1" />
<arg name="tgt_component" default="1" />
<arg name="log_output" default="screen" />
<arg name="fcu_protocol" default="v2.0" />
<arg name="respawn_mavros" default="false" />
<include file="$(find mavros)/launch/node.launch">
<arg name="pluginlists_yaml" value="$(find mavros)/launch/apm_pluginlists.yaml" />
<arg name="config_yaml" value="$(find mavros)/launch/apm_config.yaml" />
<arg name="fcu_url" value="$(arg fcu_url)" />
<arg name="gcs_url" value="$(arg gcs_url)" />
<arg name="tgt_system" value="$(arg tgt_system)" />
<arg name="tgt_component" value="$(arg tgt_component)" />
<arg name="log_output" value="$(arg log_output)" />
<arg name="fcu_protocol" value="$(arg fcu_protocol)" />
<arg name="respawn_mavros" default="$(arg respawn_mavros)" />
</include>
</launch>
启动launch之后。
实物图中pixhawk原本连在树莓派上,修改 ip方法
$ sudo vi /etc/network/interfaces.d/interfaces-eth0
$ sudo vi /home/pi/static-ip.conf
顺时针,逆时针
rostopic pub -r 5 /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1700, 1500, 1500, 1500, 1500]"
rostopic pub /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1300, 1500, 1500, 1500, 1500]"
左,右 x
rostopic pub -r 1 /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1500, 1500, 1300, 1500, 1500]"
rostopic pub /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1500, 1500, 1700, 1500, 1500]"
前后 y
rostopic pub -r 1 /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1500, 2000, 1500, 1500, 1500]"
rostopic pub /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1500, 1500, 1300, 1500, 1500, 1500]"
上下
rostopic pub /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1700, 1500, 1500, 1500, 1500, 1500]"
rostopic pub /mavros/rc/override mavros_msgs/OverrideRCIn "channels: [1500, 1500, 1300, 1500, 1500, 1500, 1500, 1500]"
手柄使能
rosrun mavros mavparam set SYSID_MYGCS 255
rosservice call /mavros/cmd/arming 1
---------------
ROS使能
rosrun mavros mavparam set SYSID_MYGCS 1
rosservice call /mavros/cmd/arming 1
------------
停止
rosservice call /mavros/cmd/arming 0
----------------