Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Brainstorms connection problems and Python problem
01-02-2014, 01:20 PM,
#1
Brainstorms connection problems and Python problem
Hello! I'm trying to fly my helicopter (Blade mCX2 RTF) with the Emotiv epoc headset running the program through python 2.7.6 and I am a beginner in this field.
I just want to open a simple python window, click RUN MODULE and codes work correctly without problems in Windows 8 (Puzzlebox Synapse and Puzzlebox Brainstorms).
How is this possible?
(I try this but is not enough:
source: trunk/Puzzlebox/Synapse/Emotiv/Server.py
source: trunk/Puzzlebox/Synapse/Emotiv/Client.py
source: trunk/Puzzlebox/Brainstorms/Helicopter_Control.py)

On the other hands, when i try the second way; to run the Puzzlebox Brainstorms with Puzzlebox Synapse, in the first program i click "connect" on the RC helicopter window at Transmitter Type (COM3 in my PC), this program just shut down automatically.
Someone could help me please?

Thank you very much.

Alejandro


Attached Files Thumbnail(s)
   
Reply
01-05-2014, 04:11 PM,
#2
RE: Brainstorms connection problems and Python problem
(01-02-2014, 01:20 PM)alejandrocontenti Wrote: [b]Hello! I'm trying to fly my helicopter (Blade mCX2 RTF) with the Emotiv epoc headset running the program through python 2.7.6 and I am a beginner in this field.
I just want to open a simple python window, click RUN MODULE and codes work correctly without problems in Windows 8 (Puzzlebox Synapse and Puzzlebox Brainstorms).
How is this possible?

Hello Alejandro, many thanks for writing and using our forums!

While we haven't tested our Brainstorms or Synapse software under Windows 8, there's no reason it shouldn't work.

The first recommendation would be to run from source through the command prompt, and pay careful attention to any error messages returned to the display, or which Windows itself might pop up. For example Brainstorms and Synapse communicate with one another by opening a TCP port on the local system. Windows Firewall might ask about this, or silently block the port (I'm not familiar with any changes Microsoft might have made to the Windows security model since Windows 7).


The are some basic instructions for getting up and running directly from source code here:

http://brainstorms.puzzlebox.info/tracker/wiki/HowToRunFromSourceUnderWindows


(01-02-2014, 01:20 PM)alejandrocontenti Wrote: On the other hands, when i try the second way; to run the Puzzlebox Brainstorms with Puzzlebox Synapse, in the first program i click "connect" on the RC helicopter window at Transmitter Type (COM3 in my PC), this program just shut down automatically.
Someone could help me please?

This sounds like Windows blocking either the port being open (Brainstorms will request port 8194, Synapse will request 13854) or access to the serial port ("COM" port). Running from source would provide an error message as to what is going on.


The next recommendation would be to avoid using Synapse for now and just focus on getting the helicopter working before the EEG. You should be able to get to the point where it is flying by using the buttons in Brainstorms' GUI interface before turning to the EEG.

From the command line you can also test running Helicopter_Control.py directly. You should see something like this:

$ python2.7 Helicopter_Control.py
INFO: [Brainstorms:Helicopter_Control] Using PySide module
<---- [Helicopter Remote] Main thread running
ERROR: could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0' /dev/ttyUSB0


This error is simply saying that it couldn't open the serial port (in this case because the necessary cable is not connected).

You can specify the device path with --device and also issue a command by using "--command=fifty_percent_thrust" or "--command=fly_forward" and so on. The complete list of accepted commands is listed in the source code:

http://brainstorms.puzzlebox.info/tracker/browser/trunk/Puzzlebox/Brainstorms/Helicopter_Control.py#L141


Finally, for control with an Emotiv EPOC you might find it is easier to use "EmoKey" to simulate keypresses, once you have Brainstorms up and running.


Good luck!
Reply
01-06-2014, 02:17 AM,
#3
RE: Brainstorms connection problems and Python problem
Thank you very much for your help! Big Grin
Today I will try all that and then i will tell you if it works.
Happy Holidays
Reply
01-09-2014, 06:14 PM,
#4
Sad  RE: Brainstorms connection problems and Python problem
Hello all there! I'm still trying but I fail to fly my helicopter directly with Helicopter_Control.py
This is what I get:

INFO: [Brainstorms:Helicopter_Control] Using PySide module
<---- [Helicopter Remote] Main thread running
data_payload: 0000005e05ff0a4b0e17135414aa
data_payload: 0000005e05ff0a4b0e17135414aa
data_payload: 0000005e05ff0a4b0e17135414aa
data_payload: 0000005e05ff0a4b0e17135414aa
data_payload: 0000005e05ff0a4b0e17135414aa

Then i understood that these are the codes that perform this:

data_payload: 0000005e05ff0a4b0e17135414aa (neutral)

data_payload: 0000035405ff0a4b0e17135414aa (hover)

data_payload: 0000035405ff0b540e17135414aa (fly_forward)

data_payload: 0000005e05ff08aa0e17135414aa (fly_back)

Someone can help me please?

I add 2 new pictures of the oscilloscope signal at the antenna: the pc_signal and the remote_control_signal at neutral time.
Which part of the code I need to change to make the helicopter fly?

Thank you.

Alejandro


Attached Files Thumbnail(s)
   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)