Jump to content


Obteining data from UAVObjects withouth using GCS


  • Please log in to reply
32 replies to this topic

#21 bigluis

bigluis

    Member

  • Members
  • PipPip
  • 26 posts
  • Country: flag of United States United States

Posted 18 January 2012 - 05:06 PM

I can't find the GCSReceiver Objects when I look for it. On the other hand, in the above code I'm using the ManualControlCommand module and it doesn't work.

How can I determine what failsafe could be giving me problems for ManualControlCommand?

Edited by bigluis, 18 January 2012 - 05:27 PM.


#22 D-Lite

D-Lite

    Core Team

  • Members
  • PipPipPip
  • 968 posts
  • Country: flag of Germany Germany


Posted 19 January 2012 - 09:59 AM

View PostBrian, on 18 January 2012 - 03:48 PM, said:

When I use my transmitter, I do a standard arming sequence (yaw right).  I'm not sure how the GCS controller arms the copter.  You might want to look in the manualcontrol module (I believe that's what it's called) to figure out the arming sequence and failsafes that are in place.

I think the GCS directly sets the FlightStatus object to arm/disarm. You can look at the gcscontrol plugin to see what excatly is happening on the GCS side (ground/openpilotgcs/src/plugins/gcscontrol/)

#23 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 19 January 2012 - 01:45 PM

View Postbigluis, on 18 January 2012 - 05:06 PM, said:

I can't find the GCSReceiver Objects when I look for it. On the other hand, in the above code I'm using the ManualControlCommand module and it doesn't work.

How can I determine what failsafe could be giving me problems for ManualControlCommand?

I wasn't talking about the ManualControlCommand object, I was talking about the ManualControl module, which is in flight/Modules/ManualControl/manualcontrol.c.  You'll see the code in there that handles the failsafes.  For example, if you want to act like you're the GCS control, you need to swap GCSTelemetryStatus/FlightTelemetryStatus messages correctly or else it will fall back to using the transmitter, which will fail if you don't have a transmitter.


#24 bigluis

bigluis

    Member

  • Members
  • PipPip
  • 26 posts
  • Country: flag of United States United States

Posted 23 January 2012 - 10:26 PM

What happen when the GCS and the Copter are establishing the communication?

Is that code correct if I want to establish communication?

uint8_t NewStatus[1]={1};
while (STOP==FALSE) {	   /* loop for input */
printf("\nR: ");  
ReadMsg();	 //Read data from Copter Control
GCSTelemetryStatsStatusSet(GCSTELEMETRYSTATS_STATUS_HANDSHAKEREQ); //Set GCS Telemetry Status to HANDSHAKEREQ
}


#25 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 23 January 2012 - 11:30 PM

I don't know all the details of the handshake that happens, but there is a sequence of messages that are passed back and forth the end up with the telemetry status on both ends being connected.  I believe there's also periodic updates that ensure that the connection is still established.  You should be able to find the code in the flight and GCS telemetry modules.

#26 bigluis

bigluis

    Member

  • Members
  • PipPip
  • 26 posts
  • Country: flag of United States United States

Posted 24 January 2012 - 12:44 AM

Can I use the UAVtalk transmitter in linux instead of the GCS to send and receive data to the Copter.

Edited by bigluis, 24 January 2012 - 12:48 AM.


#27 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 24 January 2012 - 12:56 AM

My UAVTalk transmitter is a combination of custom hardware and a branch of the OpenPilot code that (for the most part) replaces the transmitter interface with an XBee interface that transmits UAVTalk messages.  All it does is either relay receiver messages from a real transmitter (in the case of the first version of the box), or generates the receiver messages by reading the analog sticks in a transmitter.

If you have a similar piece of hardware, you can do the same thing.  In this case, arming is the same as it is with a real transmiter (e.g. minimum throttle and yaw right).


#28 bigluis

bigluis

    Member

  • Members
  • PipPip
  • 26 posts
  • Country: flag of United States United States

Posted 25 January 2012 - 03:08 PM

Hello.

In your UAVTalkTransmitter you have two codes
  • ./flight/Transmitter/System/transmitter.c which I imagine that is the main code for the controller
  • ./flight/Modules/TransmitterControls/transmittercontrol.c which I imagine that is the code for the controller module inside the copter.
Are my suppositions correct?

Or do I must use the first code with the second code in the controller?

#29 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 25 January 2012 - 03:48 PM

The flight/Transmitter directory contains the main routine, hardware configuration, etc. for my transmitter hardware.

The TransmitterControl module is a module that reads the hardware (PPM in the case of the transmitter box, and analog sticks / digital switches in the case of the actual transmitter.  This module also passes the messages between the GCS input port and the output port to the copter, and injects the GCSReceiver objects.  I think this is really the code that you want to look at if you're trying to make something similar.


#30 bigluis

bigluis

    Member

  • Members
  • PipPip
  • 26 posts
  • Country: flag of United States United States

Posted 25 January 2012 - 03:58 PM

How can I use those codes in Linux. I mean, when I put make transmitter at the console, it makes the code for an STM32, right?

Or can I use the build code into Linux?

Do I must change the make file to use it into Linux?

Edited by bigluis, 25 January 2012 - 04:00 PM.


#31 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 25 January 2012 - 04:18 PM

It's pretty STM32 specific, so you can't use it directly.  You're just going to have to use it as an example.


#32 bigluis

bigluis

    Member

  • Members
  • PipPip
  • 26 posts
  • Country: flag of United States United States

Posted 25 January 2012 - 07:44 PM

I have a question, the transmittercontrol module goes into both the copter and the controller, right?

If that is correct, that means that I must do my own module for controlling the Copter using the computer. don't I?

#33 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 25 January 2012 - 09:00 PM

No.  It resides only on the controller.  It sends GCSReceiver messages to the copter, which interprets them the same as having a receiver hooked up to the copter.  In the most simple form (the transmitter box with the PPM receiver in it) it essentially acts as a remove receiver, so the receiver is located in the external box, and the receiver inputs are relayed over the telemetry link as GCSRecever objects.