go away spammer

Author Topic: Software to send PC joystick values to robot using BT (LEGO MINDSTORMS NXT)  (Read 9029 times)

0 Members and 1 Guest are viewing this topic.

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Hi all!
I'm new to the forum, and it looks like a great one!
Please forgive my poor English, I'm not a native speaker.
I've got a question, and I've been searching for an answer a long time.

I have built a MINDSTORMS NXT robot (tank).
I want to remote control it  (Bluetooth) using my PC joystick.

Joystick: logitech freedom 2.4 Ghz. Connected to my PC using USB.

I want to do all the programming on the NXT side (NXT-G or NXC). I do NOT want to code my computer (like C).

What I am looking for is a PC program/utility that does nothing more than sending joystick values (axis values and button presses) to the NXT via bluetooth (serial COM-port).
I am NOT looking for direct control => I want to program my NXT to respond to the joystick changes the way I want.

I've searched for a long time, and haven't found anything.
I don't understand why it is so hard to find.


All I need is a PC utility that reads joystick values, and sends these values to a BT device over a COM-port.
(that does not recquire any PC-side programming).

Does anyone know something like this?

Thank you all very much!

~~ Martijn Hellemans

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Someone else coded one (python): http://principialabs.com/joystick-control-of-a-servo/.  On another note, it's probably easier to program it PC side than on the NXT... your computer has at least 100x the processing power and 10000x the memory. 

Offline macdad-

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 5
    • LoneWolf's Circuits
A good multipurpose/multiplatform utility that I use is RoboRealm which works with Lego Mindstorms(Both RCX and NXT), you can get a free 30-day trial on it.
http://www.roborealm.com/index.php

But you could also try NQC(I use it too), it has a direct control feature built-in(And its free):
http://bricxcc.sourceforge.net/

Other than that, you would have to learn C or Visual Basic to write your own utility to control your NXT(As the NXT cannot interface with Joysticks, Keyboards, Mice or anything else connected to the host computer)

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Thank you for the suggestions!

Someone else coded one (python): http://principialabs.com/joystick-control-of-a-servo/.  On another note, it's probably easier to program it PC side than on the NXT... your computer has at least 100x the processing power and 10000x the memory. 
Well... My robot is quite complicated, and however I know a little bit of NXC, I want to program this one in NXT-G. I have got no PC programming experience at all, that's why I don't want to code the computer.
Perhaps I was unclear.


I am looking for a small windows program/utility (executable) that sends joystick changes to a BT apparatus connected to the PC (serial BT connection /com-port). I really want to keep all the programming about "what to do with that  joystick data" on the NXT (experience issue).

A good multipurpose/multiplatform utility that I use is RoboRealm which works with Lego Mindstorms(Both RCX and NXT), you can get a free 30-day trial on it.
http://www.roborealm.com/index.php

But you could also try NQC(I use it too), it has a direct control feature built-in(And its free):
http://bricxcc.sourceforge.net/

Wich is exactly what I don't need... I have bricxcc wich also has a direct controll function. But this is useless to me, for this robot. I need more advanced functions.

The only thing usefull to me is a small windows executable that sends joystick updates to a serial bluetooth communication.
NO direct control, NO PC hand-coding.

There is no NXT specific software for this, but the concept is quite general, so the software does not have to have anything to do with the NXT at all to work...
The program should read PC joystick values, and send these to a device connected via BT, what that device is, doesn't matter.

Thank you all for the replies!

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
I don't know any utility that you could just drop in, but writing code for a joystick on the PC (yes I know you said you weren't interested) is really simple and well documented and might be the best solution.
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
— Oscar Wilde

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
I don't know any utility that you could just drop in, but writing code for a joystick on the PC (yes I know you said you weren't interested) is really simple and well documented and might be the best solution.

hmm.
If there isn't any software availible, I suppose that is my only option (besides NXTender, but it does not work on my system).
So that whould mean coding in something like C (wich whould be the easiest for me since I know NXC, a C variant), and compiling that into an .exe?
I am a complete newby in PC coding, no experience at all!

Is there perhaps another way to link a logitech joystick to an NXT (NXT-G)?
Thank you.

Offline macdad-

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 5
    • LoneWolf's Circuits
You could still try RoboRealm and give their free trial a whirl, it does support joysticks and communicating with your NXT. That's 'bout the closest utility for your purposes.

Other than that you could just try googling "Controlling an NXT with C", and you'll be very happy to know that Microsoft offers a free IDE(Integrated Dev Enviroment) for C++, called Visual Studio C++, which is very similar to NXC.

Offline voyager2

  • Supreme Robot
  • *****
  • Posts: 463
  • Helpful? 6
    • Voyager Robotics
BrixCC (the IDE for NXC) has a utility for controlling the NXT...
Go into BrixCC (make sure the brick is turned on)--->Tools--->Brick Joystick or Remote
Either one will do
And Admin said "Let there be robots!"
And it was good.

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
BrixCC (the IDE for NXC) has a utility for controlling the NXT...
Go into BrixCC (make sure the brick is turned on)--->Tools--->Brick Joystick or Remote
Either one will do

I stated in my previous post that I know and use the bricxcc remote.
I also said that is not what I'm looking for.
I do NOT need direct control!
I want to relay (raw) joystick values to the NXT using BT, no control, just information.

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
You could still try RoboRealm and give their free trial a whirl, it does support joysticks and communicating with your NXT. That's 'bout the closest utility for your purposes.

Other than that you could just try googling "Controlling an NXT with C", and you'll be very happy to know that Microsoft offers a free IDE(Integrated Dev Enviroment) for C++, called Visual Studio C++, which is very similar to NXC.

Thank you. This post has been very helpful to me.
I'll certainly give it a go.
But any other suggestions still welcome!

Ps. I'm a bit surprised no one mentioned NXTender (http://www.tau.ac.il/~stoledo/lego/NXTender/)...
This does exactly what I need, but for strange reasons it does not run on my system... Perhaps I'll work to find a solution for that.
Check it out! It's an amazing piece of software!

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
You could also use LabView.  Here's a link on monitoring a joystick or a mouse using LabView.  In addition you can configure it to transmit/receive serial data over com ports pretty easily.  I understand you can also use it for Bluetooth communication, but I haven't worked with Bluetooth in LabView yet.  Here's a link to get you started with Bluetooth.

--- edited for clarity
« Last Edit: October 06, 2010, 06:15:59 PM by knossos »
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
— Oscar Wilde

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
You could also use LabView.  Here's a link on monitoring a joystick or a mouse using LabView.  In addition you can configure it to transmit/receive serial data over com ports pretty easily.  I understand you can also use it for Bluetooth communication, but I haven't worked with it yet.  Here's a link to get you started with Bluetooth.

That might work... But I prefer a free solution.
I already have NXT-G and bricxcc (wich I haven't used to it's ceiling yet), so buying another programming enviorment is a bit silly (for the moment...).
Thank you!
« Last Edit: October 06, 2010, 09:22:26 AM by Dino_Martino »

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
I figured as much.  That's why it wasn't my first suggestion :).  Although I've been playing with LabView (haven't done any NXT or bricxcc stuff myself) and I'm liking it a lot so far.


-- edited for typo
« Last Edit: October 06, 2010, 06:17:41 PM by knossos »
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
— Oscar Wilde

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
I figured as much.  Thats why it wasn't my first suggestion :).  Although I've been playing with LabView (haven't done any NXT or stuff myself) and I'm liking it a lot so far.

I could ask another 1000 questions about that, but I'm sure I can find the answers somewhere on the web. I'll check things out in the weekend. I'll either try to fix NXTender, or search for another piece of freeware.

Thank you very much for your help!
--ps. any other suggestions still welcome!:)

Offline Dino_MartinoTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
I finally got NXTender to work, problem solved.
I'm embarrased to tell how I solved it...

In the windows enviorment-variable "PATH", I forgot to type ";" at the end...
A small mistake...:-[ , But that's why NXTender dind't recognice the call to "java"...

Anyway, Thanks a lot for your help!

 


Get Your Ad Here

data_list