|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||||
|
||||||
|
Re: FRCSim Mecanum Drive example help
That's correct. Both the gearsbot and pacgoat models are tank drive.
|
|
#4
|
|||
|
|||
|
Re: FRCSim Mecanum Drive example help
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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. |
|
#7
|
|||||
|
|||||
|
Re: FRCSim Mecanum Drive example help
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|