没懂你说的action为什么要有参数…………
DJI的GS action有两个文档…不知道你说的是哪一个:
http://dn-dev-dji-front.qbox.me/ ... WayPointAction.html
和
http://dn-dev-dji-front.qbox.me/ ... WayPointAction.html
如果是单纯要建立一个action object,用上面那个文档:
action有:
Way_Point_Action_Stay - stay and no action
Way_Point_Action_Simple_Shot - take photo, the number of photo the camera takes will be determined by the paramList
Way_Point_Action_Video_Start - take video, the length of the record camera takes will be determined by the paramList
Way_Point_Action_Video_Stop - stop taking video
Way_Point_Action_Craft_Yaw - turn the aircraft heading, 0~360 in the parameter list will determine its heading. 0 for north, 90 for east.
Way_Point_Action_Gimbal_Yaw - gimbal yaw
Way_Point_Action_Gimbal_Pitch - gimbal pitch
一个action object最多有16个action(不限类型)
actionNum
就是这个list里面一共多少个action,所以少于16
actionRepeat
我对这个的理解是这个action list要被重复多少次,但是不明白为什么也有16的限制
paramList
这个也是一个array,和action list一一对应,提供每个action所需的参数。对于不需要参数的action我也不知道该填啥因为文档里面没有写。
---
如果单纯是在waypoint里面加action不建议这种方式,推荐下面文档里面写的:
直接用mWayPoint.addAction来做,
调用看这里(http://dn-dev-dji-front.qbox.me/ ... /android/index.html)
两种类型:
mWayPoint.addAction(GroundStationOnWayPointAction.Way_Point_Action_Craft_Yaw, -130);
就是yaw旋转,后面-130为参数。
相同后面数字表示参数的有:Way_Point_Action_Gimbal_Pitch / Way_Point_Action_Gimbal_Yaw
mWayPoint.addAction(GroundStationOnWayPointAction.Way_Point_Action_Video_Stop, 0);
这里是停止录像,后面的0为重复次数。
相同后面数字表示重复次数的有:Way_Point_Action_Simple_Shot / Way_Point_Action_Video_Start
---
我假设你知道怎么改变云台角度所以太general的东西我就不说了,直奔你的主题。
gimbal的角度分为两种,relative和absolute。
relative的意思是转【到】相对于机头旋转多少角度,absolute的意思是转多少单位就是多少单位
relative angle的单位是度,absolute的单位是……… DJI自己的单位……
具体的用法是:
DJIGimbalRotation Pitch= new DJIGimbalRotation(true, false, false, 1200);
此处的第二个参数false表述absolute,改为true就是relative。
举个例子就是: true,true,true,0 是一定可以让云台复位的(旧版本固件可能做不到,而且用relative归位云台转动速度是absolute的1/3…所以我一直是算absolute单位来控制云台)
单位的话,我用的inspire 1:
对于pitch:
旧版固件:relative 和 absolute 都是: [0,1000],750对应水平,0为竖直向下
新版固件:relative 改成[-90,30],absolute还是[0,1000]
如何区分新版和旧版固件:
gimbalCallback里面如果返回的pitch为relative,用demo APP看下那个值的范围就好了。
对于yaw:
我并不知道relative,因为嫌太慢了没用过。
对于absolute:因为Inspire 1的云台可以转好几圈,所以范围大的离谱。
【但是】,在我实际使用中我发现允许设定的单位只有[-1800,1800],对应到角度就是左右90度,所以当你需要转好几个90度的时候…… 你要么用absolute(我没用过),要么多转几次……
---
大概就酱了。
heading 指的是到达这个waypoint时候的机头朝向,东北地坐标系,0正北,-/+180正南,+为东,-为西
DJIMaxActionCount 是在哪里看到?我这里没这个参数,如果指的是waypoint上的action,文档里面给的是no more than 16
以及有问题我都直接发邮件问他们,他们不更新文档喜欢每天回复很多邮件不觉得累那么我也不觉得累=。=
DJI还是赶紧更新文档吧,长痛不如短痛