Go to Post You're part of what makes FIRST so special. - Matt Krass [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 4.75 average. Display Modes
  #1   Spotlight this post!  
Unread 01-11-2011, 08:32 PM
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by jhersh View Post
Our team used the 3D Pro to drive a mecanum bot last year and it was very natural. The kids picked up how to control it very quickly.
so Joe would you have an example of code we might use just to see how we might drive our bot? I have some kids who can program but they are just starting out and it would help alot if we had some code we knew worked and then could build on it

Did you use two joysticks?

thanks John
Reply With Quote
  #2   Spotlight this post!  
Unread 01-11-2011, 11:28 PM
ChiefDelphi ChiefDelphi is offline
Registered User
no team
 
Join Date: Jan 2011
Location: Canada
Posts: 2
ChiefDelphi is an unknown quantity at this point
Re: Mechanum wheel programming in C++

Yes, It would be extremely helpful if the sample C++ Code for Mechanum Wheels is provided with a good explaination

Thanks
Reply With Quote
  #3   Spotlight this post!  
Unread 01-11-2011, 11:41 PM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by johncap100 View Post
so Joe would you have an example of code we might use just to see how we might drive our bot? I have some kids who can program but they are just starting out and it would help alot if we had some code we knew worked and then could build on it
I've attached an example. It's based on the IterativeRobot base class but could be moved to SimpleRobot (by just putting a loop around the Drive method).

Quote:
Originally Posted by johncap100 View Post
Did you use two joysticks?
Nope. Just one Extreme 3D Pro.

-Joe
Attached Files
File Type: cpp MecanumDefaultCode.cpp (1.4 KB, 239 views)
Reply With Quote
  #4   Spotlight this post!  
Unread 01-11-2011, 11:48 PM
ChiefDelphi ChiefDelphi is offline
Registered User
no team
 
Join Date: Jan 2011
Location: Canada
Posts: 2
ChiefDelphi is an unknown quantity at this point
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by jhersh View Post
I've attached an example. It's based on the IterativeRobot base class but could be moved to SimpleRobot (by just putting a loop around the Drive method).
Wow, the Example is well detailed and easy to understand. But the question is does this code move the robot or its given for example purpose?


Thanks
Reply With Quote
  #5   Spotlight this post!  
Unread 01-12-2011, 12:55 AM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by ChiefDelphi View Post
Wow, the Example is well detailed and easy to understand. But the question is does this code move the robot or its given for example purpose?
While I haven't tested it out, I believe it should move the robot if all mechanical and wiring is correct.

-Joe
Reply With Quote
  #6   Spotlight this post!  
Unread 01-12-2011, 07:56 AM
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by jhersh View Post
I've attached an example. It's based on the IterativeRobot base class but could be moved to SimpleRobot (by just putting a loop around the Drive method).



Nope. Just one Extreme 3D Pro.

-Joe
Thanks Joe will give it a try
John
Reply With Quote
  #7   Spotlight this post!  
Unread 01-16-2011, 01:24 PM
Micah Chetrit's Avatar
Micah Chetrit Micah Chetrit is offline
Registered User
FRC #3276 (NSR)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: New London - Spicer MN
Posts: 90
Micah Chetrit is on a distinguished road
Re: Mechanum wheel programming in C++

Ok, I am really new to C++, we are using the SimpleRobot class. can help me out by telling me what kind of a loop I put around it (MecanumDefaultCode.cpp) and some details like that. Do I need a .h file to go with it? What else do I need to add to make it work with the default sample code? by the way, does anyone know of a tutorial that explains how to use most/all of the WPI Library commands? I don't know how to use hardly any of them. this is my first year coding and all of the programmers graduated last year so I'm looking for any possible help.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-16-2011, 11:35 PM
CodeMonkeyMatt CodeMonkeyMatt is offline
Registered User
FRC #2605
 
Join Date: Jan 2011
Rookie Year: 2008
Location: WA
Posts: 46
CodeMonkeyMatt is on a distinguished road
Re: Mechanum wheel programming in C++

Most likely, you would want to put the mecanum code inside of the "while(IsOperatorControl())" loop of the OperatorControl function of the SimpleRobot class. Also, I believe the code would change slightly as the SimpleRobot template uses different variable names, and does not use pointers. (I don't have our classmate in front of me, so someone correct my code if I'm mistaken)

Code:
while(IsOperatorControl())
{
myRobot.MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetTwist());
...
This is a good document for getting started in C++ and making sure that Windriver is properly set up (which you may or may not need).
http://firstforge.wpi.edu/sf/docman/...tation/doc1197

While I haven't looked through this very much yet, this should document most, if not all the WPILib classes with examples of using them. It is written for both Java and C++, so make sure you don't get the code mixed up.
http://firstforge.wpi.edu/sf/docman/...tation/doc1196
Reply With Quote
  #9   Spotlight this post!  
Unread 01-23-2014, 09:00 PM
jyaple's Avatar
jyaple jyaple is offline
Registered User
FRC #1013
 
Join Date: Jan 2013
Location: Arizona
Posts: 10
jyaple is an unknown quantity at this point
Re: Mechanum wheel programming in C++

Would you be able to program/run it with only a two axis joystick? My team wants to run this years bot as a CO-OP and have two joysticks with one Logictech controller for the shooter/loader system.
__________________
Tin Man~
Reply With Quote
  #10   Spotlight this post!  
Unread 01-23-2014, 10:09 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,002
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by jyaple View Post
Would you be able to program/run it with only a two axis joystick? My team wants to run this years bot as a CO-OP and have two joysticks with one Logictech controller for the shooter/loader system.
You can use whatever operator interface you like.

How are you planning to take advantage of the 3 degrees of freedom of a mec drivetrain using only one 2-axis joystick? Changing modes with a button perhaps??

WPILib has code for mecanum.


Reply With Quote
  #11   Spotlight this post!  
Unread 01-18-2011, 11:00 AM
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: Mechanum wheel programming in C++

So Joe I downloaded your code and am trying to get it to build in Windriver.
Sorry but myself and the kids are just getting familiar with Windriver. I opened it but it would build. Any suggestions?

thanks John

Quote:
Originally Posted by jhersh View Post
I've attached an example. It's based on the IterativeRobot base class but could be moved to SimpleRobot (by just putting a loop around the Drive method).



Nope. Just one Extreme 3D Pro.

-Joe
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 10:18 AM.

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