Tridge,
If you have a moment could you review my febe-gimbal3 branch which has an attempt at splitting the AP_Mount library into a frontend/backend?
https://github.com/rmackay9/rmackay9-ardupilot/tree/febe-gimbal3/libraries/AP_Mount
The main purpose is to add support for MAVlink enabled mounts so you’ll see there’s a new AP_Mount_MAVLink class. It’s still not fully functional though because I haven’t come up with a way to set the sysid and component id for the gimbal. I plan to somehow pull that from the GCS_MAVLink::MALink_routing class.
Some other changes include:
· Moving support for a 2nd gimbal into the library itself instead of having 2 separate mount objects created in the autopilot
· Renamed the MODE parameter to DFLT_MODE (i.e. default mode) and added a separate _mode variable. I did this because the only purpose of having the MODE parameter was so we could set the mode to a default mode at various times including startup and after a ROI command has completed.
· Removed some configure_cmd and control_cmd which did nothing
· Other bits of cleanup like replacing pointers with references
-Randy
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matthias,
It’s really great you’re working on the AlexMos support. We discussed on the dev call the issue with the Z-axis drift so not sure how we’re going to deal with that.
For #1 and #2, I’ll move some helper functions to the front-end so they can be reused by the Servo or the future AlexMos class.
Thanks for checking out the code. I’ve left send-angle-target there assuming that the MAVLink gimbal developers will want the flight controller to send the angle targets when we’re in RC_Targetting and GPS_Targeting mode. Theoretically the gimbal could do it all by itself but let’s see.
Next step is to add in the sysid and component id discovery, get Tridge’s review and then push to master. I’m happy to help you merge your code into this if you’d like or you can do it after it’s gone into master.
-Randy
Matthias,
I’ve now moved the all the rc-targeting and gps-targeting logic into the “backend” so when you’re ready to integrate the AlexMos stuff, hopefully you won’t need to implement as many functions as before. It’s still in the same febe-gimbal3 branch. https://github.com/rmackay9/rmackay9-ardupilot/tree/febe-gimbal3
I’ll likely push this new lib to master on Fri/Sat after Tridge/Grant have branched ahead of their next Plane release.
-Randy
From: Randy Mackay [mailto:rmac...@yahoo.com]
Sent: 13-Jan-15 12:40 PM
To: 'drones-...@googlegroups.com'
Cc: 'Andrew Tridgell'
Subject: RE: [drones-discuss] AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Matthias,
It’s really great you’re working on the AlexMos support. We discussed on the dev call the issue with the Z-axis drift so not sure how we’re going to deal with that.
For #1 and #2, I’ll move some helper functions to the front-end so they can be reused by the Servo or the future AlexMos class.
Thanks for checking out the code. I’ve left send-angle-target there assuming that the MAVLink gimbal developers will want the flight controller to send the angle targets when we’re in RC_Targetting and GPS_Targeting mode. Theoretically the gimbal could do it all by itself but let’s see.
Next step is to add in the sysid and component id discovery, get Tridge’s review and then push to master. I’m happy to help you merge your code into this if you’d like or you can do it after it’s gone into master.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Matthias Badaire
Sent: 13-Jan-15 6:08 AM
To: drones-...@googlegroups.com
Cc: Andrew Tridgell
Subject: Re: [drones-discuss] AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Thanks Randy,
This STorM32 is quite interesting, they’ve even put some effort into a (sortof) MAVlink interface!
http://www.olliw.eu/storm32bgc-wiki/Serial_Communication#Mavlink_Communication
If someone has one of these and a pixhawk I could try to write another gimbal lib to talk to it and we could go from there.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Luis Vale Gonçalves
Sent: 16-Jan-15 2:06 AM
To: drones-...@googlegroups.com
Cc: tri...@tridgell.net
Subject: Re: [drones-discuss] AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
I've replaced my AlexMos Controllers by STorM32 and I only regret the time I've lost setting up the AlexMos controllers (both 8 and 32 bit)......
Matthias,
Ok, that patch is looking pretty good so far. I’ve got a couple of comments that I’ll add to the PR but I’ve merged it into my branch as well. Looking forward to your tests showing it can move the gimbal.
The issue of which serial port to use needs to be fixed for the MAVLink-gimbal lib as well. The hard-coded method you’re using for the moment is fine. We can fix that for sure.
Matthias,
Very nice. I’ve merged in your latest patches to my febe-gimbal3 branch and Tridge will give a final review before we push to master. During that review we will add that final bit to allow the dynamic setting of the serial port for both the MAVLink and AlexMos versions.
Olli,
Thanks for chiming in.
The Mount library’s primary purpose is to let the flight controller control the angle of the camera gimbal so it can do things like “ROI” (i.e. point at a “region of interest”) or move to a particular angle during a stage of the mission. In the future we will probably add other features like allow the flight controller to tell the gimbal to relax in some situations (maybe when the vehicle is disarmed). To do this the gimbal should respond to a COMMAND_LONG message (http://mavlink.org/messages/common#COMMAND_LONG) which contains a DO_MOUNT_CONTROL command (search for #205 on http://mavlink.org/messages/common). The link below shows where the mount library sends this message out:
Sending the heartbeat message at 1hz would be great because it would broadcast the gimbal’s presence to the FC (flight controller) and GCS.
http://mavlink.org/messages/common#HEARTBEAT :
type = 26 which is the new entry we will add to the MAV_TYPE enum for gimbals
autopilot = whatever you want, could be a new entry in the enum if you like
base_mode – could leave this as zero or maybe make it a value that best matches one of the items from MAV_MOUNT_MODE
custom_mode – fill this is with whatever number you like to represent the mode that the gimbal is in
system_status – see instructions in MAV_STATE enum
mavlink_version – no need to fill in
In the heartbeat message (and all others) you’ll also need to send a system-id and component id. Ideally the system id should match the vehicle’s system id (which defaults to 1 for arducopter, plane, etc) so you might want to make it configurable. The component id can be any number above 1 (the flight controller uses “1”).
If the GCS ever sends messages with the gimbal’s sysid/compid over the telemetry link to the FC, the FC will forward the message onto the gimbal.
It would probably be good to support the SET_MODE message and/or the COMMAND_LONG with DO_SET_MODE inside it.
The parameter related messages would be good to implement so that ground stations like MAVLink can be used to update the gimbal’s parameters.
PARAM_REQUEST_LIST - when the gimbal receives this it should send a PARAM_VALUE message for each of its parameters
PARAM_REQUEST_READ – gimbal should respond with a PARAM_VALUE for a single parameter
PARAM_SET – gimbal should set the parameters value
To provide detailed status the gimbal could implement the SYS_STATUS message.
To get data from the flight controller the gimbal should send a REQUEST_DATA_STREAM message to the flight controller with the stream-id and rate it wants the data at. I think the highest rate possible is 50hz. The “stream-id” is really a group of messages but sadly it’s not well defined what’s in each group. For arducopter you can figure it out by looking here: https://github.com/diydrones/ardupilot/blob/master/ArduCopter/GCS_Mavlink.pde#L821. So for example, the ATTITUDE message is in “STREAM_EXTRA1”. If look on the common page (http://mavlink.org/messages/common ) in the MAV_DATA_STREAM table you’ll see MAV_DATA_STREAM_EXTRA1 is “10”.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of OlliW
Sent: 15-Jan-15 10:55 PM
To: drones-...@googlegroups.com
Cc: tri...@tridgell.net
--
Olli,
Response inline..
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of OlliW
Sent: 17-Jan-15 1:40 AM
To: drones-...@googlegroups.com
Subject: Re: [Bulk] Re: [drones-discuss] AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Randy
THX a lot for these very detailed instructions. I guess I won't make it to implement them all at once, but would do it step by step. It seems to me that the first thing to do is the COMMAND_LONG message - DO_MOUNT_CONTROL message, and then the heartbeat. Some further small questions
1) The angles send by the COMMAND_LONG message - DO_MOUNT_CONTROL message, are they with respect to earth or with respect to the copter? I presume they are with respect to earth.
If so one actually would need to focus on getting the copter attitude from the FC.
>>> They are with respect to the earth.
1b) Is this command supposed to be acknowledged by sending a MAV_CMD_ACK thing?
>>> Yes, according to the MAVLink spec it should although on the flight controller side we don’t do anything with the ACKs. If it was coming from a ground station then it might do something with them (although I’ll bet it doesn’t either).
2) I've never understood the heartbeat thing, or, more generally how arbitration is done on the mavlink link. I mean, there are now at least two items sending heartbeats, the FC and the gimbal, what happens when their heartbeats overlap, or other messages overlap? How is that handled or avoided by MAVlink?
>>> all mavlink messages have a source system-id and component-id so the receiver knows where the message (including the heartbeat msg) came from. Many messages (but not all) also have a target-system-id/target-component-id which allows the sender to specify which item on the serial bus should take note of the message.
>>>As a side note, in AC-3.3 the flight controller maintains a routing table of serial ports to system-id/component-id pairs so it knows where each device can be reached. It then forwards messages received on one serial bus to the other serial buses. In this way the gimbal’s heartbeat will make its way down to the ground station and conversely the ground station will also be able to send commands to the gimbal.
2b) Does the heartbeat thing imply that also the FC is sending a heartbeat to the gimbal controller?
>>> Yes, I think it will. I haven’t actually checked but I think so. The gimbal may even receive heartbeats from the ground station. Normally the gimbal should be able to differentiate what is sending the heartbeat by checking the messages’s MAV_TYPE but we’re only recently getting into this multiple devices/vehicles on the same bus so I think it could be messed up in some cases. Still, we can fix that if you find issues.
3) What would be the serial speed of MAVlink?
Since quite some data is needed the standard 115200 could be too slow.
>>> I’ve tested with a companion computer doing up to 1.5Mbps but Tridge (plane lead) says he’s seen drop-outs and recommends not going above 921khz. The baudrate is set on a Pixhawk/APM2 with the SERIALX_BAUD parameter (where X can be 0=USB,1=Telem1,2=Telem2). It seems we don’t have a parameter to control the speed of Serial4 which is probably where the gimbals should go so I’ll talk to Tridge about adding that.
4) The data stream initiated via REQUEST_DATA_STREAM, how tightly is it scheduled in time, I mean, then it's 50Hz, how reliable are these 20ms, is it 18-22ms, or what? What are the rules here?
>>> I’ve never tested the scheduling but I’ll bet it’s not fantastic. I could easily imagine fairly regularly that you’d see slips of 4ms and occasional slips of up to 10ms. I think the info in the messages would be recent (within the last 2.5ms) but it’s low on the scheduler priority list so it’s timing will vary.
Obtaining the FC attitude is IMHO most important, otherwise things wouldn't work well if at all, so I'm trying to figure out if a MAVlink link is suitable for that, or if one should not better consider establishing a dedicated communication channel with some specific priorities.
Another, and maybe better method would be to get a data stream which includes both the attitude and the target angles (maybe both in quaternion form).
>>> I guess we could do some special stuff in the Mount driver for the STorM that sends out the vehicle attitude information and target angles at 50hz so we wouldn’t necessarily have to force the gimbal to go through the whole REQUEST_DATA_STREAM bit. There are alternative messages we could use (see http://mavlink.org/messages/common) like: MAV_CMD_DO_MOUNT_CONTROL_QUAT and ATTITUDE_QUATERNION (#31). We could send those instead.
>>> if having a Pixhawk would be useful for this work I think Craig Elder can send you one. I’m sure he’s reading this thread.
THX again,
Olli
>>> all mavlink messages have a source system-id and component-id so the receiver knows where the message (including the heartbeat msg) came from. Many messages (but not all) also have a target-system-id/target-component-id which allows the sender to specify which item on the serial bus should take note of the message.
Olli,
Ah ok. So there aren’t two transmitters on a single serial cable, but because the flight controller at least has multiple serial connections it can transmit info from multiple sources down a single cable. So for example commands from the ground station would be received by the FC on telemetry 1. The FC checks each message’s target and sends those meant for the gimbal down Serial4 and it might send its own attitude info down that line as well but the packets would be sent one after the other.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of OlliW
Sent: 18-Jan-15 9:46 AM
To: drones-...@googlegroups.com
Subject: Re: [Bulk] Re: [drones-discuss] AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Randy
OlliW,
I think you could skip sending the heartbeat. We’re going to write a custom SToRM library to talk to the gimbal anyway so we can be more flexible than a general use MAVLink channel would be, we could even not use MAVLink if necessary although it’s a little more work for us (the AlexMos library doesn’t use MAVLink). As you guess, it’ll have a parameter (MOUNT_TYPE) that the user will set to specify they’re using a SToRM gimbal.
For the setup through the ground station, I was thinking the full set of parameters is visible, settable through those MAVLink PARAM_* commands and then the ground station developers could come up with custom screens in their various applications. This is really just a nice-to-have and we’re a ways from that.
We won’t be able to port this functionality back to the 8-bit controllers. Of course, it’s open source so somebody can try but it will be difficult. I suspect that Walkera (and others) will all switch to 32bit CPUs in their next generation of vehicles. I’m sure Craig will send you at least a Pixhawk to help you get a dev env going.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of OlliW
Sent: 23-Jan-15 11:32 AM
To: drones-...@googlegroups.com
Subject: Re: [Bulk] Re: [drones-discuss] AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Hey Randy
--
Luis,
Thanks for the help with this. I think the first test should be to check talking with the storm gimbal over mavlink to read it’s parameters.
So load up the Pixhawk with the latest firmware. “ArduCopter-v2.px4” from http://firmware.diydrones.com/Copter/latest/PX4-quad/
Somehow wire up telem1 or telem2 to the gimbal’s serial port. The Pixhawk pin info is here: http://copter.ardupilot.com/wiki/common-pixhawk-overview/#pixhawk_conector_pin_assignments
Set the SERIAL1_BAUD or SERIAL2_BAUD to match the baud of the gimbal. I guess it’ll be “57” (=57600) or “115” (=115200). Make sure to reboot the board after changing these parameters.
The connect to the Pixhawk with the mission planner. If the hearbeats successfully pass from the Storm gimbal to the MP, a little “SysId Selector” dialog box should pop-up asking which device (i.e. vehicle or gimbal) you want to connect to. If it doesn’t you can try pressing Ctrl-X. I’ve attached a pic of what it looks like. If that works then go to the MP’s Config/Tuning page’s full parameter list and the Gimbal’s params should be visible.
It’s a bit of a miracle if you get this far without any problems.
The next step would be to test the do-mount-control messages. I think the best way to do that is for me to write a small AP_Mount_SToRM32 library. It’ll be very similar to the AP_Mount_MAVLink but it’ll let us customise what we send down. That won’t take me too long I think.
-Randy
P.S. I’m ordering a SToRM32 board immediately.
<StormTesting_MPSysIdSelector.png>
--
Olli,
FYI - I’m planning to buy from roswell57 which seems partnered with gimbal24 and includes the 2nd IMU and 25cm cable. Sound like a decent choice?
http://www.roswell57.com/control_boards.html
-Randy
--
I’ve taken a first stab at a SToRM32 mount library. It’s very unlikely to work straight off but it’s a start especially in case anyone else wants to hack away on it (I will be away in Taiwan this week so I won’t be too responsive).
The new library is in my repo’s storm32-wip1 branch. It’s the last two commits shown here:
https://github.com/rmackay9/rmackay9-ardupilot/commits/storm32-wip1
A pre-compiled binary for a pixhawk can be found here:
https://dl.dropboxusercontent.com/u/3852647/SToRM32/ArduCopter-v2-stormVer1.px4
The easiest way to test whether the gimbal is pointing properly is to:
· Load up above pixhawk firmware to board using MP’s install firmware, custom firmware link
· Load up the randy-storm32-param.param file to the pixhawk using MP’s “Full Param List” or “Full Param Tree” screen and press “Write Params” button
· Set vehicle’s MNT_DEFLT_MODE to “1” (i.e neutral)
· Reboot board
· On MP’s “Full Param Tree” screen set MNT_NEUTRAL_X (for roll) and MNT_NEUTRAL_Y (for pitch) parameters to desired lean angle. Mount should move to these
· If the above method works try setting the MNT_DEFLT_MODE to “3” (RC_Targeting = pilot controlled tilt) and move ch6 tuning knob on transmitter to see if mount moves properly
Some more detailed notes on the library:
· hard-coded to send the MAVlink messages on Telem2 (or whatever SERIALX_PROTOCOL = “2”). We will make this more flexible later.
· hard-coded to send to SysId=71, CompID=67
· sends a command-long containing the MAV_CMD_DO_MOUNT_CONTROL (see http://mavlink.org/messages/common)
o param 1 ~ 3 are pitch, roll and yaw in degrees. These are “earth frame”.. i.e. absolute tilt or heading angles that have not been adjusted based on the vehicle’s tilt angle. If this is no good we can change this.
o Param 7 (the mode) is always sent as “2” = MAV_MOUNT_MODE_MAVLINK_TARGETING. My guess is we will eventually need to add more possible values to the MAV_MOUNT_MODE enum found on this page: http://mavlink.org/messages/common. Maybe “Relaxed” and “Rate” will be needed.
o I know it’s confusing that both the mount and vehicle have a “mount mode” and they can be different but this is because only the vehicle can handle most modes like “mav-mount-mode-gps” while the gimbal is only responsible for pointing in a particular direction so it only has one mode (for now).
o These messages are sent at 1hz or 50hz depending upon the vehicle’s mount mode. If the vehicle’s mount mode is “retract”, “neutral” or “mavlink-targeting” it’s sent at 1hz. If it’s “rc-targeting” (i.e. pilot’s rc input is being sent) or “gps-point” (we’re pointing at a lat,lon,alt location) then we send at 50hz. We can definitely throttle the 50hz down or only send when the angles change by a certain amount if necessary.
o Tilt of -90 = point straight down, +90 = striaight up
o Roll of -45 = lean left at 45 deg, +45= lean right at 45 deg (I think)
o Yaw of -45 = point north-west, +45 = point north-east. Normally we expect yaw to be ignored on a 2-axis gimbal but I guess it should work on a 3-axis
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Luis Vale Gonçalves
Sent: 14-Feb-15 1:23 PM
To: drones-...@googlegroups.com
Cc: tri...@tridgell.net
--
Sorry, missed one step in the “way to test” section. Add in red.
-Randy
From: Randy Mackay [mailto:rmac...@yahoo.com]
Sent: 14-Feb-15 10:04 PM
To: 'drones-...@googlegroups.com'
Cc: 'tri...@tridgell.net'; 'Glenn Gregory'
Subject: RE: [Bulk] [drones-discuss] Re: AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
I’ve taken a first stab at a SToRM32 mount library. It’s very unlikely to work straight off but it’s a start especially in case anyone else wants to hack away on it (I will be away in Taiwan this week so I won’t be too responsive).
The new library is in my repo’s storm32-wip1 branch. It’s the last two commits shown here:
https://github.com/rmackay9/rmackay9-ardupilot/commits/storm32-wip1
A pre-compiled binary for a pixhawk can be found here:
https://dl.dropboxusercontent.com/u/3852647/SToRM32/ArduCopter-v2-stormVer1.px4
The easiest way to test whether the gimbal is pointing properly is to:
· Connect the SToRM32 gimbal to Telem2
· Load up above pixhawk firmware to board using MP’s install firmware, custom firmware link
· Load up the randy-storm32-param.param file to the pixhawk using MP’s “Full Param List” or “Full Param Tree” screen and press “Write Params” button
· Set vehicle’s MNT_DEFLT_MODE to “1” (i.e neutral)
· Reboot board
· On MP’s “Full Param Tree” screen set MNT_NEUTRAL_X (for roll) and MNT_NEUTRAL_Y (for pitch) parameters to desired lean angle. Mount should move to these
· If the above method works try setting the MNT_DEFLT_MODE to “3” (RC_Targeting = pilot controlled tilt) and move ch6 tuning knob on transmitter to see if mount moves properly
Some more detailed notes on the library:
· hard-coded to send the MAVlink messages on Telem2 (or whatever SERIALX_PROTOCOL = “2”). We will make this more flexible later.
· hard-coded to send to SysId=71, CompID=67
· sends a command-long containing the MAV_CMD_DO_MOUNT_CONTROL (see http://mavlink.org/messages/common)
o param 1 ~ 3 are pitch, roll and yaw in degrees. These are “earth frame”.. i.e. absolute tilt or heading angles that have not been adjusted based on the vehicle’s tilt angle. If this is no good we can change this.
o Param 7 (the mode) is always sent as “2” = MAV_MOUNT_MODE_MAVLINK_TARGETING. My guess is we will eventually need to add more possible values to the MAV_MOUNT_MODE enum found on this page: http://mavlink.org/messages/common. Maybe “Relaxed” and “Rate” will be needed.
o I know it’s confusing that both the mount and vehicle have a “mount mode” and they can be different but this is because only the vehicle can handle most modes like “mav-mount-mode-gps” while the gimbal is only responsible for pointing in a particular direction so it only has one mode (for now).
o These messages are sent at 1hz or 50hz depending upon the vehicle’s mount mode. If the vehicle’s mount mode is “retract”, “neutral” or “mavlink-targeting” it’s sent at 1hz. If it’s “rc-targeting” (i.e. pilot’s rc input is being sent) or “gps-point” (we’re pointing at a lat,lon,alt location) then we send at 50hz. We can definitely throttle the 50hz down or only send when the angles change by a certain amount if necessary.
o Tilt of -90 = point straight down, +90 = striaight up
o Roll of -45 = lean left at 45 deg, +45= lean right at 45 deg (I think)
o Yaw of -45 = point north-west, +45 = point north-east. Normally we expect yaw to be ignored on a 2-axis gimbal but I guess it should work on a 3-axis
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Luis Vale Gonçalves
Sent: 14-Feb-15 1:23 PM
To: drones-...@googlegroups.com
Cc: tri...@tridgell.net
Subject: [Bulk] [drones-discuss] Re: AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Hi all.
--
--You received this message because you are subscribed to a topic in the Google Groups "drones-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/drones-discuss/gIkqFECW_B8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to drones-discus...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
Luis,
To Rob’s point I think comments like “The current situation is ridiculous” will likely not get you the collaborative responses you’re hoping for.
Sorry for not replying sooner, I was off in Taiwan for a few days.
Great news that the gimbal is moving! Based on this milestone, I’ve pushed the SToRM32 library into master so that it doesn’t fall out of date as other changes go in.
Re the angle directions, I think the roll response is ok (+ve = roll right) but pitch is reversed (+ve should be up, but it’s down). We haven’t tested yaw but I suspect it’s ok.
OlliW, are you happy to reverse the pitch response in the SToRM32 gimbal itself?
To get the vehicle angles we can either proactively send them from the gimbal library so the gimbal software can use the REQUEST_DATA_STREAM message to tell the FC what data it wants and the rate. http://mavlink.org/messages/common#REQUEST_DATA_STREAM.
target_system = “1” by default but should configurable or captured from the heartbeats received from the flight controller.
target_component = “1” by default but should be configurable or captured from heartbeat
req_stream_id = “10” (i.e. MAV_DATA_STREAM_EXTRA1 from MAV_DATA_STREAM enum in http://mavlink.org/messages/common)
req_message_rate = “10” (for 10hz, “50” for 50hz, etc)
start_stop = “1” (to start sending)
So what should we do next? Some ideas below, feel free to change or add more:
· Add a relaxed mode in which the gimbal doesn’t try to do any stabilization so it doesn’t shake when you push the button to turn on the camera
o we could relax the gimbal when the Pixhawk’s safety button is flashing (which means the ESCs are disabled). This would be its state on startup so the user could turn on the Go-Pro/camera, then push the safety button, the gimbal will start stabilizing and then he/she can take-off.
o To do this we would add a 5th MAV_MOUNT_MODE called MAV_MOUNT_MODE_RELAXED. We could tell the Gimbal to go into this mode either with a COMMAND_LONG containing the SET_MODE command or set param #7 of the COMMAND_LONG’s DO_MOUNT_CONTROL message. I vote for using do-mount-control.
· Send accelerometer corrections so the gimbal angles remain accurate during fast maneuvers
· Write a wiki page showing how to connect the SToRM32 to the Pixhawk.
· Do a blog post advertising that SToRM32 support is coming in AC3.3 including a video showing how it’s connected and proof that it’s speaking MAVlink (i.e. show that it’s possible to connect to the mission planner directly to see the parameters)
-Randy
Another idea add to the “do next” list in red.
-Randy
From: Randy Mackay [mailto:rmac...@yahoo.com]
Sent: 20-Feb-15 12:15 PM
To: 'drones-...@googlegroups.com'
Subject: RE: [drones-discuss] Re: AP_Mount frontend/backend split in advance of adding support for MAVLink/AlexMos gimbals
Sorry for not replying sooner, I was off in Taiwan for a few days.
Great news that the gimbal is moving! Based on this milestone, I’ve pushed the SToRM32 library into master so that it doesn’t fall out of date as other changes go in.
Re the angle directions, I think the roll response is ok (+ve = roll right) but pitch is reversed (+ve should be up, but it’s down). We haven’t tested yaw but I suspect it’s ok.
OlliW, are you happy to reverse the pitch response in the SToRM32 gimbal itself?
To get the vehicle angles we can either proactively send them from the gimbal library so the gimbal software can use the REQUEST_DATA_STREAM message to tell the FC what data it wants and the rate. http://mavlink.org/messages/common#REQUEST_DATA_STREAM.
target_system = “1” by default but should configurable or captured from the heartbeats received from the flight controller.
target_component = “1” by default but should be configurable or captured from heartbeat
req_stream_id = “10” (i.e. MAV_DATA_STREAM_EXTRA1 from MAV_DATA_STREAM enum in http://mavlink.org/messages/common)
req_message_rate = “10” (for 10hz, “50” for 50hz, etc)
start_stop = “1” (to start sending)
So what should we do next? Some ideas below, feel free to change or add more:
· Add a relaxed mode in which the gimbal doesn’t try to do any stabilization so it doesn’t shake when you push the button to turn on the camera
o we could relax the gimbal when the Pixhawk’s safety button is flashing (which means the ESCs are disabled). This would be its state on startup so the user could turn on the Go-Pro/camera, then push the safety button, the gimbal will start stabilizing and then he/she can take-off.
o To do this we would add a 5th MAV_MOUNT_MODE called MAV_MOUNT_MODE_RELAXED. We could tell the Gimbal to go into this mode either with a COMMAND_LONG containing the SET_MODE command or set param #7 of the COMMAND_LONG’s DO_MOUNT_CONTROL message. I vote for using do-mount-control.
· Send accelerometer corrections so the gimbal angles remain accurate during fast maneuvers
· Ease set-up by pulling (or pushing) configuration between FC and SToRM32. This could include “Pan Mode Default Settings”, angle maximums (?), anything else?
· Write a wiki page showing how to connect the SToRM32 to the Pixhawk.
· Do a blog post advertising that SToRM32 support is coming in AC3.3 including a video showing how it’s connected and proof that it’s speaking MAVlink (i.e. show that it’s possible to connect to the mission planner directly to see the parameters)
-Randy
On 18 February 2015 at 22:29, Luis Vale Gonçalves <luis...@gmail.com> wrote:
Luis,
Ok, sure we can add that to the list. Allowing it to be connected to Serial 4/5 is easy but also allowing 1 & 2 to be also used as MAVlink channels makes it a little more difficult (i.e. three simulataneous MAVLink enabled channels is some extra work).
-Randy
Back in APM2 days, if we wanted two devices (telem radios and minimOSD) to work w/o modifying the board, we would make a special cable that would send the serial ports vcc, ground, and TX cables to the vcc, ground, and RX pins on the minimOSD, effectively “splitting” the signal.. would this kind of thing work with the gimbal, or would that create problems since the gimbal is a 2-way communicator where the minimOSD is read-only?
Also the changes of MNT parameters are quite relevant.
Unfortunately I was not able to test, as I couldn't find the options required to have it working.
The private build from Randy's fork worked fine, although hardcoded to serial 2.
So I assume that I should wait a few more days to test answer build?
BTW: Great job Randy....As usual :)
Luis
Tridge,
If you have a moment could you review my febe-gimbal3 branch which has an attempt at splitting the AP_Mount library into a frontend/backend?
https://github.com/rmackay9/rmackay9-ardupilot/tree/febe-gimbal3/libraries/AP_Mount
The main purpose is to add support for MAVlink enabled mounts so you’ll see there’s a new AP_Mount_MAVLink class. It’s still not fully functional though because I haven’t come up with a way to set the sysid and component id for the gimbal. I plan to somehow pull that from the GCS_MAVLink::MALink_routing class.
Some other changes include:
· Moving support for a 2nd gimbal into the library itself instead of having 2 separate mount objects created in the autopilot
· Renamed the MODE parameter to DFLT_MODE (i.e. default mode) and added a separate _mode variable. I did this because the only purpose of having the MODE parameter was so we could set the mode to a default mode at various times including startup and after a ROI command has completed.
· Removed some configure_cmd and control_cmd which did nothing
· Other bits of cleanup like replacing pointers with references
-Randy
--
OlliW,
Re the attitude, yes, we’ve always used Bill Premerlani’s DCM so it makes sense that all the frames are consistent with Bill’s papers. Recently we’ve introduced an EKF but we’ve kept the DCM’s conventions at least on the surface.
We can do quaternions if that would be easier/better for you but it sounds like it’s not. If we were to switch to quaternions we could use a COMMAND_LONG with a MAV_CMD_DO_MOUNT_CONTROL_QUAT inside it (see http://mavlink.org/messages/common) and if it were helpful we could also send the vehicle attitude down as a quaternion using the ATTITUDE_QUATERNION message: http://mavlink.org/messages/common#ATTITUDE_QUATERNION.
We talked about the SToRM32 gimbal on the dev call today with Luis for a respectable length of time and some technical notes are below. These are mostly ardupilot improvements but:
· We’d like to stick with using MAVLink messaging if possible but we’re going to make some improvements including:
a. Automatically detecting which telemetry port the gimbal is attached to by listening for its heartbeat
b. Query the gimbal for its min/max angles and write them to the ardupilot mount object’s min/max angles so it doesn’t ask for angles that the gimbal can’t provide and also reduce the ardupilot side’s setup burden for the user.
c. Add an additional MAVLink channel to ardupilot/pixhawk so people can use the MAVLink enable SToRM32 gimbal without having to sacrifice a MAVLink port which may already be used for a MinimOSD and Telemetry.
-Randy
P.S. my SToRM32 gimbal arrived over the weekend so I now have hardware to experiment with.
--