Search found 25 matches

by e-Rok
Tue Dec 16, 2014 5:36 pm
Forum: Support
Topic: Crazyradio in PRX mode
Replies: 12
Views: 4275

Re: Crazyradio in PRX mode

I agree, given the pre-existing code, this doesn't seem like a great use case for the with statement. That being said, would the example I gave set the self.cradio attribute for the entire scope of the class?
by e-Rok
Mon Dec 15, 2014 4:32 pm
Forum: Support
Topic: Crazyradio in PRX mode
Replies: 12
Views: 4275

Re: Crazyradio in PRX mode

For example, in the RadioDriver class' connect() method, would the following set self.cradio within the entire scope of the class/corresponding RadioDriverThread class?: if self.cradio is None: with Crazyradio(devid=int(uri_data.group(1))) as self.cradio: if self.cradio.version >= 0.4: self.cradio.s...
by e-Rok
Mon Dec 15, 2014 4:18 pm
Forum: Support
Topic: Crazyradio in PRX mode
Replies: 12
Views: 4275

Re: Crazyradio in PRX mode

If crazyradio instantiation is done in the radiodriver.py module, or in a test module for that matter, how would I wrap crazyradio usage with a 'with' statement? I want to guarantee that I am using the same crazyradio each time I perform an action from a RadioDriver instance.
by e-Rok
Fri Dec 12, 2014 4:42 pm
Forum: Developer Discussions
Topic: Format of instructions/ack
Replies: 3
Views: 1339

Re: Format of instructions/ack

I cloned your edited code from github that allows the crazyradio to be put into PRX mode. In the firmware, am I correct in stating that the following is where acknowledgements are formed and sent?: from main.c: case RADIO_MODE_PRX: { if (!radioIsRxEmpty()) { ledSet(LED_GREEN, true); IN1BC = radioRxP...
by e-Rok
Wed Dec 10, 2014 5:24 pm
Forum: Developer Discussions
Topic: Format of instructions/ack
Replies: 3
Views: 1339

Format of instructions/ack

I've sifted through the CRTP code to figure out the instructions/ack of the Commander using a Crazyradio to a quadrotor. I have a couple of questions about this process. From my understanding, the packet sent is a CRTPPacket() containing the port that the packet comes from, and the data. The data co...
by e-Rok
Mon Dec 08, 2014 3:23 pm
Forum: Developer Discussions
Topic: CRTP Question
Replies: 3
Views: 1212

Re: CRTP Question

You've sort of answered my question. Outside of the scope of this module, where is radiodriver.RadioDriver.send_packet() called? I understand that the user must call it, but which module in this project actually instantiates RadioDrivers and communicates packets with other radios?
by e-Rok
Fri Dec 05, 2014 5:39 pm
Forum: Developer Discussions
Topic: CRTP Question
Replies: 3
Views: 1212

CRTP Question

Hi, I'm trying to wrap/modify the RadioDriver and Log classes to send/receive instructions and variable values through two CrazyRadio dongles. Threading is a bit over my head. My question is about the threading in the radiodriver.py module. In the RadioDriver._thread.run() method, the data is sent b...
by e-Rok
Mon Nov 24, 2014 4:24 pm
Forum: Support
Topic: Crazyradio in PRX mode
Replies: 12
Views: 4275

Re: Crazyradio in PRX mode

Is there anything that I need to do to use all of the Crazyradio drivers with python 3.x instead of 2.7? The wiki says to use python 2.7. Also, thank you for providing your crazyradio driver update. I added a _find_devices() outside of all of the class definitions, although I'm not sure that I have ...
by e-Rok
Thu Nov 20, 2014 10:27 pm
Forum: Developer discussions
Topic: Problem with crazyradio.send_packet()
Replies: 0
Views: 1186

Problem with crazyradio.send_packet()

Hi, It seems that if pyusb1 is true, then dev.write() takes only 4 parameters. Your code: def send_packet(self, dataOut): """ Send a packet and receive the ack from the radio dongle The ack contains information about the packet transmition and a data payload if the ack packet contained any """ ackIn...
by e-Rok
Thu Nov 20, 2014 8:46 pm
Forum: Support
Topic: Crazyradio in PRX mode
Replies: 12
Views: 4275

Re: Crazyradio in PRX mode

If you can send me that crazyradio.py code that would be great. There's something subtle that I'm not understanding, though. How is the firmware connected to/ interacting with the python driver?