Go to Post FIRST is not a "buy it and build it kit robot" competition. - sanddrag [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-01-2015, 10:18
u2fletch u2fletch is offline
Registered User
FRC #4610 (BearTecs)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Bastrop, TX
Posts: 3
u2fletch is an unknown quantity at this point
FRCSim Mecanum Drive example help

Installed FRCSim on my Ubuntu system last night in an effort to get an example of Mecanum drive up and running to show our programming team today.

Was able to run the Gearsbot sample code, (although my gamepad mapping was not correct, can fix that) but was wondering if anyone else has gotten the simple drive examples to run. All the code that I think is the bare minimum to run looks like it is there in the code examples, but I cannot get the simulated bot to respond.

Really would like to give my new programmers something to work with this week.
  #2   Spotlight this post!  
Unread 06-01-2015, 16:10
u2fletch u2fletch is offline
Registered User
FRC #4610 (BearTecs)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Bastrop, TX
Posts: 3
u2fletch is an unknown quantity at this point
Re: FRCSim Mecanum Drive example help

Okay, so broke down and used RobotBuilder to build a sample robot. 4 motor config with a single Sidewinder3D joystick. Here is the code for the Drivetrain class:

public void takeJoyStickInput(Joystick joy){
robotDrive41.mecanumDrive_Cartesian(joy.getRawAxis (1),joy.getRawAxis(2),joy.getRawAxis(0),0);
}

Needed to use the getRawAxis() function to map the axes properly on the Sidewinder, but the problem is that the FRCSim robot drives just like tankdrive. Fore-aft joystick moves as expected, twist rotates the robot, but left-right joystick just gives you forward and back just like the fore-aft.

The RobotBuilder says it supports holonomic drive under the 4 motor controller, so I am wondering if FRCSim does NOT model that type of drive?
  #3   Spotlight this post!  
Unread 06-01-2015, 16:20
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: FRCSim Mecanum Drive example help

Quote:
Originally Posted by u2fletch View Post
so I am wondering if FRCSim does NOT model that type of drive?
That's correct. Both the gearsbot and pacgoat models are tank drive.
  #4   Spotlight this post!  
Unread 06-01-2015, 19:50
u2fletch u2fletch is offline
Registered User
FRC #4610 (BearTecs)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Bastrop, TX
Posts: 3
u2fletch is an unknown quantity at this point
Re: FRCSim Mecanum Drive example help

Quote:
Originally Posted by Joe Ross View Post
That's correct. Both the gearsbot and pacgoat models are tank drive.
Good news is that the programming students were very excited about being able to test their code from RobotBuilder in the sim. You can't go sideways, but the rest of the simulation works well.
  #5   Spotlight this post!  
Unread 12-01-2015, 09:18
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: FRCSim Mecanum Drive example help

Hi Guys,

This seems to be a good place to put my questions. I noticed that u2fletch in his code for mecanum_cartisian used 0 for the 4th argument of the robot drive object. From my understanding (and please correct me if I'm wrong) I believe a gyro is used so that you get field centric strafing when driving. This means that when no matter what your rotation, the robot will still straif to left (therefore the robot itself is moving backwards) right? Say I don't want field centric movement like this, and would like robot centric drive. Does that 0 value make the drive robot centric? Any help is really appreciated. Thanks guys!

Last edited by Cinnamon Toast : 12-01-2015 at 10:06.
  #6   Spotlight this post!  
Unread 15-01-2015, 15:32
jman1783 jman1783 is offline
Registered User
FRC #2900 (Mighty Penguins)
Team Role: Engineer
 
Join Date: Dec 2009
Rookie Year: 1999
Location: Arlington, VA
Posts: 14
jman1783 is an unknown quantity at this point
Re: FRCSim Mecanum Drive example help

I was able to switch the controls at some point between Tank and Arcade drive. I forgot how I did it, though Let me dig up my code and see what I changed - I know I modified it to work with the Logitech joystick with a yaw axis.

OSRF has not yet attempted modeling a mecanum drive setup for an FRC robot, but we're excited that teams are trying things like this. If you pull it off, and it continues to run in real-time, let us know! This would be great to share with the community.
__________________
"Just remember - whether you think you can or you think you can't, you're right." -Stewart Gilligan Griffin
  #7   Spotlight this post!  
Unread 15-01-2015, 15:35
Whippet's Avatar
Whippet Whippet is offline
MIT Class of 2020
AKA: Luis Trueba
FRC #4301 (New Tech Narcissists)
Team Role: Alumni
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Cambridge, MA
Posts: 1,187
Whippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond reputeWhippet has a reputation beyond repute
Send a message via Yahoo to Whippet
Re: FRCSim Mecanum Drive example help

Quote:
Originally Posted by Cinnamon Toast View Post
Hi Guys,

This seems to be a good place to put my questions. I noticed that u2fletch in his code for mecanum_cartisian used 0 for the 4th argument of the robot drive object. From my understanding (and please correct me if I'm wrong) I believe a gyro is used so that you get field centric strafing when driving. This means that when no matter what your rotation, the robot will still straif to left (therefore the robot itself is moving backwards) right? Say I don't want field centric movement like this, and would like robot centric drive. Does that 0 value make the drive robot centric? Any help is really appreciated. Thanks guys!
Yes, including the 0 in the mecanumDrive_Cartesian object causes the robot to always think it is facing away from the driver, effectively creating robot-centric drive.
__________________
2010: FRC 3043, Build Assistant
2011: FRC 3043, Head of Minibot subteam; FLL 12762, Team Captain
2012: FRC 3043, Electrical; FLL 12762, Team Captain; FTC 5670, Team Captain
2013: FRC 4301, Electrical, Team Co-Captain
2014: FRC 4301, Electrical/Programming, Team Co-Captain
2015: FRC 4301, Electrical/Programming, Team Captain
2016: FRC 4301, Chief Technical Officer; FTC 10860, 10861, and 11004: Mentor. Winner, Hub City Regional (3310 & 4063)
Closed Thread


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 03:00.

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