Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   FRCSim Mecanum Drive example help (http://www.chiefdelphi.com/forums/showthread.php?t=132221)

u2fletch 06-01-2015 10:18

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.

u2fletch 06-01-2015 16:10

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?

Joe Ross 06-01-2015 16:20

Re: FRCSim Mecanum Drive example help
 
Quote:

Originally Posted by u2fletch (Post 1422955)
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.

u2fletch 06-01-2015 19:50

Re: FRCSim Mecanum Drive example help
 
Quote:

Originally Posted by Joe Ross (Post 1422967)
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.

Cinnamon Toast 12-01-2015 09:18

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!

jman1783 15-01-2015 15:32

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.

Whippet 15-01-2015 15:35

Re: FRCSim Mecanum Drive example help
 
Quote:

Originally Posted by Cinnamon Toast (Post 1426645)
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.


All times are GMT -5. The time now is 02:43.

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