Go to Post pit visitor: "Why'd you use #35 chain?" team member "less links to CAD...." - Aren_Hill [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-01-2017, 17:40
swolverines's Avatar
swolverines swolverines is offline
Registered User
FRC #3839
 
Join Date: Jan 2017
Location: Wadena, MN
Posts: 3
swolverines is an unknown quantity at this point
LabView Joystick Help Needed

We are not great with LabView. Let's get that out of the way.

How do we change what the joysticks do? We used the base Arcade Drive and the code is working with our robot after we assigned the motors and PWMs. However, it's just forwards and backwards.

How do we make it so we can assign certain axis to do certain things?

Thanks in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2017, 17:44
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,945
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: LabView Joystick Help Needed

Arcade (the default robot project) should allow you to turn as well.
Does the robot not turn if you lean the joystick to one side or the other?
Attached Thumbnails
Click image for larger version

Name:	DefaultArcadeDrive.png
Views:	33
Size:	20.7 KB
ID:	21582  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-01-2017 at 17:47.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2017, 20:13
mshafer1 mshafer1 is offline
Programming Mentor
AKA: Matthew Shafer
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Texas
Posts: 64
mshafer1 is an unknown quantity at this point
Re: LabView Joystick Help Needed

If you're robot is only going forward and backward, it may be a mismatch between the physical system and how the motors are opened in Begin.vi (are there four motors?). If the problem persists, could you post screen shots of opening the motors in Begin.vi and what you have for setting them (in Teleop)?

Team 358 has posted a lot of example code on their website: http://www.team358.org/files/program...hp#ArcadeDrive

Please feel free to personal message or email me if you have any issues and want a quick reply.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2017, 23:06
mshafer1 mshafer1 is offline
Programming Mentor
AKA: Matthew Shafer
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Texas
Posts: 64
mshafer1 is an unknown quantity at this point
Re: LabView Joystick Help Needed

Quote:
Originally Posted by swolverines View Post
We are not great with LabView. Let's get that out of the way.

How do we change what the joysticks do? We used the base Arcade Drive and the code is working with our robot after we assigned the motors and PWMs. However, it's just forwards and backwards.

How do we make it so we can assign certain axis to do certain things?

Thanks in advance.
Just a follow up, have you been able to get this going?
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2017, 11:17
JeffB JeffB is offline
Registered User
FRC #5052 (RoboLobos)
Team Role: Mentor
 
Join Date: Apr 2015
Rookie Year: 2014
Location: Austin
Posts: 67
JeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to beholdJeffB is a splendid one to behold
Re: LabView Joystick Help Needed

As I don't see this mentioned in the thread, I'll add on to the follow up.

The first place you want to start when trying to modify joystick code is your driver station. This seems a bit strange as you don't actually code anything here. But, it's important to know WHAT you're working with.

On the left, there are several tabs. Click the 2nd from the bottom that looks like the USB plug. In this tab, you can see the joysticks connected to your PC. If you have more than one, move a joystick to see if it moves any of the values. If so, great. You're on the right one. If not, click the other. With only one joystick, we'd expect to see a change.

Towards the right of that window you'll see some mixture of Axis, square boolean LEDs, and potentially a POV. Move your joystick and watch what moves. The Axis are all labelled by their corresponding number in LabVIEW.

Push the buttons. These are numbered starting at 0. The first column is 0, 1, .... The second column starts at the next value.

It's a good idea to create a map. Grab a sheet of paper and write down what each of these are. That way, you can reference it later.

Once you know these values, take a look at the pre-built Teleop.vi. There's a "Get Joystick Values" VI that pulls off a thick orange and a thick green wire. The thick orange wires into an "Index Array" that is then fed into your motor control. The Index Array can be hovered over to see a blue box at the bottom. You can drag it down to get as many joystick axis values as you're interested in. By default, Index Array will start at 0 and count down. If that doesn't match the mapping of your joystick, right-click the input "Index" and choose "Create -> Constant" That will pop out a numeric constant that you can change to match your joystick axis value.

You can similarly add an Index Array and wire in the thick green wire to get all of your button values. With that, you can use the same methods to break out the individual values and run whatever logic you're after.
__________________
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 19:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi