Adding Support for a new MAVLink Gimbal
来源:互联网 发布:lazada平台知乎 编辑:程序博客网 时间:2024/06/07 17:57
Adding Support for a new MAVLink Gimbal
This page covers how ArduPilot interacts with a MAVLink enabled gimbal. It is meant more as a guide on how gimbal manufacturers can make their gimbals work with ArduPilot with minimum code changes to ArduPilot .
The SToRM32 gimbal is a good reference as it supports MAVLink.
Messages the gimbal should support
The gimbal should listen on the serial port for a HEARBEAT message from the vehicle. It can generally assume that the first heart beat it receives will be from the vehicle but to be certain you can check the “type” field to be sure it’s something sensible (i.e. MAV_TYPE = 1 for fixed wing, 2 for quadcopters but 6 for GCSs should be ignored).
This heart beat will contain the vehicle’s system-id and component-id. The gimbal should adopt the same system-id but should use a component-id of MAV_COMP_ID_GIMBAL (i.e. 154) for all it’s future messages. In fact, any unique component-id can be used as long as it’s not zero nor the component id of the vehicle or any other device on the vehicle.
The gimbal should send a HEARTBEAT message out the serial port at approximately 1hz
- the system-id and component-id should be as mentioned above.
- “type” should be MAV_TYPE_GIMBAL (i.e. 26).
- “autopilot” is not used so can be set to anything including MAV_AUTOPILOT_GENERIC (i.e. 0)
- “base_mode” and “custom_mode” are not used so can be set to anything (perhaps 0 is best)
- “system_status” should be set to “MAV_STATE_ACTIVE” once the gimbal is ready to accept attitude targets
To support reading/writing parameter values from the ground station the gimbal should implement these message:
- PARAM_REQUEST_READ - if the gimbal receives this message and “target_system” and “target_component” values match the gimbal’s system-id and component-id, it should respond with a PARAM_VALUE message which contains the value of the parameter specified by the “param_id” field (simply an enum, the gimbal can assign whatever enum it wishes to each of it’s internal paramters)
- PARAM_REQUEST_LIST - respond to this message by sending a PARAM_VALUE message for every parameter within the gimbal.
- PARAM_SET - respond to this by setting the internal variable to the value in the “param_value” field.
Ardupilot will send angle requests to the gimbal via MAVLink which will arrive asCOMMAND_LONG messages with the “command” field set to MAV_CMD_DO_MOUNT_CONTROL (i.e 205).
- Param #1 contains desired pitch in degrees
- Param #2 contains desired roll in degrees
- Param #3 contains desired yaw in degrees but note that the yaw is in relation to the front of the vehicle so “0” is straight ahead, “90” is to the right, “-90” is to the left.
If the gimbal needs extra data from the vehicle it can request it using theREQUEST_DATA_STREAM message.
- the target system and component id should be for the vehicle.
- “req_stream_id” can be any values in the MAV_DATA_STREAM enum. Some useful values are:
- MAV_DATA_STREAM_POSITION will cause the vehicle to send GLOBAL_POSITION_INTmessages which includes lat, lon, alt, velocity (3d) and heading)
- MAV_DATA_STREAM_EXTRA1 will send the MSG_ATTITUDE which includes euler angles for roll, pitch, yaw
Testing
To test the system, you should be able to connect the gimbal to a Pixhawk as if it’s a SToRM32 gimbal. In particular check the “Set-up through the Mission Planner (MALVink protocol)” section.
- Adding Support for a new MAVLink Gimbal
- Adding a new MAVLink Message (Code Overview)
- CMake Tutorial(7)——Adding Support for a Dashboard
- (OK) Adding a New Device - for company build and product teams only
- Adding a new board to Uclinux
- Adding a New Parameter (Code Overview)
- Adding a New Arduino Board to Ardublockly
- Adding a New Language to Ardublockly
- Adding timeout support for http request in Node.JS
- Adding a JSF view Scope to Spring scope support
- For a New Year
- Adding a New System Call into the Linux Kernel 2.6
- Adding a New Field to the Movie Model and Table
- Adding a New Flight Mode (Copter Code Overview)
- adding a new ssh key to your github account
- Adding libtool Support
- Adding new Space Window
- A new world for me
- 动态加载的资源一定要直接放在Resource目录下吗
- Android 让WebView完美支持https双向认证(SSL)
- Java中单链表的部分操作总结
- cookie和session的区别初步认识
- dul恢复drop表测试
- Adding Support for a new MAVLink Gimbal
- SNMP 服务启用方法
- 详解WMware Workstation的三种网络配置方式
- 最近做easy-ui要用到的formatter()
- linux驱动移植(nand,yaffs2) MTD分区
- 拉格朗日插值 python scipy
- Excel工具类
- ListView学习
- GitHub控件之BadgeView(数字提醒)