Hey Mark and all
Here is marks code with some add on's so that it works with a pololu servo controller board available at sparkfun.
If you are going to use that board i recommend you play around with it a bit using gtkterm first and see if you can make it do everything the manual says it can. I know mine doesn't!! For example my board seems to only work between 30 and 200 in 8-bit mode instead of between 0 and 255 or so as i would expect and the absolute position command doesn't really seem to work either. The boards are cheap though so it doesn't really matter that much. Sure beats the servo board that i made!!!!
anyway have a play.
Todd --- On Sat, 31/10/09, address@hidden <address@hidden> wrote: From: address@hidden <address@hidden> Subject: RE: [Paparazzi-devel] Tracking antenna To: address@hidden Received: Saturday, 31 October, 2009, 8:12 PM
Hi
Todd,
Yes,
you are correct - I must not have been thinking straight. Attached is the
updated source code.
I
tried to keep the code as simple as possible.
It
assumes that the tracking antenna is located at the HOME position. 0 degrees
azimuth is North, 0 degrees elevation is at the
horizon.
Initially, it will wait until GPS 3D lock is achieved then get the gps
altitude and record it as the home position altitude.
I will add the code to the pprz repository and update the Wiki
in due course.
Enjoy, Mark
ahhhh
you have:
ant_azim = atan2(gps_pos_y, gps_pos_x) * 180. / M_PI;
ant_azim = 90. - ant_azim; /* adjust so that North is 0
degrees*/
you could just change that to:
ant_azim = atan2(gps_pos_x, gps_pos_y) * 180./M_PI;
otherwise awesome!!
very clean and nice
Todd --- On Sat, 31/10/09, address@hidden
<address@hidden> wrote:
From:
address@hidden <address@hidden> Subject: RE:
[Paparazzi-devel] Tracking antenna To:
address@hidden Received: Saturday, 31 October, 2009, 1:37
AM
I
modified the ant_track.c code in the
paparazzi3/sw/ground_segment/cockpit folder to make it correctly
estimate the azimuth and elevation angles based on the information
contained in the GPS and NAVIGATION telemetry messages through the IVY
bus (see attached file).
To use
it,
1. Open a
terminal window and go to the "paparazzi3/sw/ground_segment/cockpit"
folder.
2. Compile
it with: make ant_track
3. Run it
with: ./ant_track
4. A GUI
should appear. Click on AUTO.
5. Launch an
aircraft in paparazzi (use the simulator) and you will see the
azimuth/elevation updated on the GUI.
The code
could be easily modified to send the azimuth/elevation values through a
USB serial port to a servo-based tracker.
Have
fun.
Cheers,
Mark
I know, but its hard to give you any advice without seeing the
actual code. For ex., here is my code for one of my xbee class
transmit functions below. This is taken from the working code. I use
ByteBuffer class like this:
public void sendTX(byte[] toSend, int dest) throws
IOException { int
len=toSend.length+9; ByteBuffer
buff=ByteBuffer.allocate(len); buff.put((byte)0x7E); buff.putShort((short)(len-4)); buff.put((byte)0x01);
// send RF data command buff.put((byte)0x0A); //frame id
for future ACK if
(dest==39) buff.putShort((short)0xA); //destination
address else buff.putShort((short)dest); //destination
address buff.put((byte)0x00);
//options buff.put(toSend); add_checksum(buff.array()); os.write(buff.array());
//write to output stream }
One more thing, in eclipse debug mode you can see all your data in
hex and check if this data looks correct.
my 1c. :)
Roman
2009/10/28 Todd Sandercock <address@hidden>
Sweet, i have one day of uni left then i will clean up the code
and somehow get it on svn. I don't really like the idea of putting
java on the paparazzi svn but if you want it i can do it.
for the servo controller board that i was using you needed to
send 0x80 to get it into one of the modes and a signed byte doesn't
really do the job for that
Todd
From: Roman Krashanitsa
<address@hidden>
Sent: Thu, 29 October, 2009
3:51:51 AM
Subject: Re: [Paparazzi-devel]
Tracking antenna
Hello Todd,
It would be nice if you could share your java project on svn. We
could chip in and make some additions/suggestions.
As of myself, I did implement complete paparazzi core protocol
for xbee and aerocomm on java, works fine, no errors or lockups.
Overall, I don't see any problem with java signed byte type. You need
to convert to int only if you have to compare to unsigned byte (or
rather convert unsigned to signed if its a constant). Otherwise, use
it as is.
I used standard Sun Serial API on windows and
third-party drivers on Linux, but downloaded from sun as well.
Sincerely,
Roman
2009/10/27 Todd Sandercock <address@hidden>
Well i tried a few different api's until i got
one to actually work on windows and linux. i can't remember
which one i used. My computer that had all that stuff on it
had an accident with some ati drivers last night so i have had
to revert back to intrepid and with that i don't have ....
long story short i can't open the eclipse workspace files at
the moment to see what api i actually used.
The big issue with the java api was trying to send the
"0x00". you think its sent it properly but nothing worked with
the servo controller. so i plugged 2 ftdi cables into each
other and worked out that every time that i sent a "0x00" it
turned everything after it to garbage. If you have a fix that
would be great!
The other thing with java is that there is no such
unsigned variables. so when you are trying to send anything
higher than 127 you have to use an int. DUMB!
anyway....
|
Get more done like never before with Yahoo!7 Mail. Learn
more. _______________________________________________ Paparazzi-devel
mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Get more done like never before with Yahoo!7 Mail. Learn
more. _______________________________________________ Paparazzi-devel
mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
-----Inline
Attachment Follows-----
|
Get more done like never before with Yahoo!7 Mail. Learn more.
-----Inline Attachment Follows-----
|