Forks of FRC1736 Robot Casserole 2024 Python Swerve and Web Server

Our source code python source code spiresRobot2024 is a fork of Robot Casserole FRC1736’s awesome source code.

Cool things about this source code are:

  • python
  • pylint
  • a robot webserver
  • swerve
  • field relative driver controls
  • the swerve sim
  • autonomous
  • easy logging to USB sticks, the robot webserver, and networktables

FYI @gerthworm @evanandh @Jernovak38 @yavin @JoshuaGeer @andy_q

One thing that we are noticing on our real robot is that when we do the following sequence of steps:

  • power-up the robot
  • connect the driverstation to the robot over wifi
  • enter teleop on the driverstation
  • press the left xbox stick forward to move the robot forward, field relative
  • the robot moves backwards (field relative)
  • exit teleop
  • command the driverstation to exit teleop
  • command the driverstation to join the red alliance (was blue alliance)
  • command the driverstation to enter teleop
  • press the left xbox stick forward to move the robot forward, field relative
  • the robot moves forward (field relative)

Our conclusions are that:

  • We may or may not have our robot configured correctly between the front of the robot and the azimuth offsets (.e.g. ‘FL_ENCODER_MOUNT_OFFSET_RAD’) of our swerve modules and any invert of the wheel motors (e.g. ‘FL_INVERT_WHEEL_MOTOR’) . But that is not our question.
  • Switching into teleop as well as changing our alliance color did not reset our navx gyro angle reading

We suspect that if we had powered up and down the robot after changing the alliance color, then the direction our robot moved when we pressed the left stick forward would have stayed the same, regardless of the alliance color.

Robot Casserole, we’re wondering if what we are experiencing is the intended behavior, and what are the suggested steps for starting the robot in either the red or blue alliance in autonomous or teleop?

-Thanks

-Spires 9106

2 Likes

I think I’ve reproduced this in sim.

To levelset -

Normally the initial pose is set at the time of selecting an auto routine. If auto isn’t selected or run, you’ll need to do this manually at least once.

After the first entry into teleop - be sure to rotate the robot away from you, and then hold down A for a half second, and release. This should make sure the gyro is properly oriented to the field coordinate system.

However, up until 10 seconds ago, our logic had a bug in it. This is the relevant chance you’ll need in the gyro reset logic.

Pushing a change now.

2 Likes

@gerthworm Thank you for helping us with this! We updated our code to include this change.

@stittrm @JoshuaGeer @Andy_Q I have merged this change onto both our working branch “converting-to-spires-robot” as well as “main”

Hope your season is off to a great start. Thanks again!

2 Likes

@gerthworm (FYI - @Jernovak38 @brian_may ) We had a great tournament run using your code base. Here’s us in a very tight match as 8th alliance captain (as a pure defensive bot, not able to manipulate notes), coming within in 2 points of alliance 1, who eventually won the Blue Banner).

Thanks for all of your support!

2 Likes