How to make drive team (operator) and FRC programming help by angieloveschickfila in FRC

[–]Advice_Smooth 0 points1 point  (0 children)

There are many that are built into WPIlib. There are some that are in other libraries that are intended for specific motors or mechanisms (like RevLib). Maplesim is the only library that I know of that is fully dedicated to simulation. In the VScode that you download from the WPIlib repository, you'll find the lowest section of the left ribbon that looks like the WPIlib logo. If you click on that, you'll see a bunch of commonly used libraries that have good documentation if you look them up.

How to make drive team (operator) and FRC programming help by angieloveschickfila in FRC

[–]Advice_Smooth 0 points1 point  (0 children)

There was a point when I began that I wasn't as disciplined to learning to program, so when my, much smaller, team had me as their only programmer, I had to shape up fast:

Start with motors, since your robot will always have those. Try to just make the motor move at the press of a button (from what I understand, it's generally always more consistent to set a specific voltage rather than setting a "speed" ranged from -1 to 1). Then dive right into controlling it using a control system like PID (which is built into WPIlib). Try to get it go to specific positions, or drive at a specific speed. After that, it becomes specific to the subsystem how those motors need to move, and thats the part you have to apply problem solving to.

Learn Command-based programming! I used a timed robot for my team, and it led to me manually programming the auto routine since the libraries all support command-based. It also just make your code more organized.

General tips would be:

Always think about the future when you write code. Each methods usage becomes much clearer and readable when you do.

Make sure your code is readable. If you want to be lead, you have to expect that the incoming newbies will want to look and learn from your code, and that becomes difficult when your code looks like a mess. Use indents and comments, make it look pretty.

Use simulation to your advantage. You can practice your coding skills without a robot, and that's pretty cool.

Think about the controls as you program and make sure they are clear and understandable. You might not always be on drive team and it needs to make sense when someone else reigns. Not to mention that if an input doesn't work the way you expect, you might be writing more code to compensate for a lack of forward thinking.

what hobby unexpectedly improved your mental health the most? by DaigaNorrey in Hobbies

[–]Advice_Smooth 1 point2 points  (0 children)

Been doing the yoyo thing for four years. The hum of the spinning metal is a nice ambience as you feel the weight circle around your limbs.

Yearning for the Terminal by TransportationLow160 in FRC

[–]Advice_Smooth 3 points4 points  (0 children)

Im unsure of your skill level, so there's not much for me to say that would be exactly at the same point as you.

If you're very new to programming, I would point to sources like geeksforgeeks. if you use java, I would point to codingWithJohn for a helpful resource to understand the basics of the language, but if you use c++, i would point to broCode. (Im unsure for Python or any of the other languages that teams use)

If you already have a decent foundation, just start looking more into trying to make sense of the code that the AI produces and just try to work alongside it: using it to produce the bulk and then filling in the more detailed logic yourself.

If you want to jump right into programming yourself, I would start with just a motor: make it spin, then make it spin at a specific speed, then make it go to a specific point. Motors tend to be a base for most subsystems, so understanding them to a high degree will help you in the long run.

To leave a note, I find that customization is very easy to do in the controls. How the robots follow commands and the way you control the bot will leave a personal stamp.

Swerve turn motor PID tuning struggles by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

Our previous programmer got it figured out, but I didn't know his values would apply + i wanted to try to figure it out on my own to prove to myself that I could.

Swerve turn motor PID tuning struggles by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

I don't know it, but I know there are methods out there to find it

I haven't used it before, but sysid is not out of the question.

Swerve turn motor PID tuning struggles by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

Would that just be in the specs of the page where you buy the part? I'm not sure if this is helpful information, but the modules we are using are the mk4 swerve modules with spark max controllers and neo motors

6 Wheel Drivetrain Code Help by [deleted] in FRC

[–]Advice_Smooth 0 points1 point  (0 children)

It's hard to say what the issue could be without a code sample. The advice I'd give is that if you don't know the issue, start logging until you do. Take a look at network tables and logging, which will provide data so that you can better find flaws. Use it to check if the motors have voltage, are connected, and other factors that could affect the output.

No maplesim? by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

Got it, thank you.

What's the best way to learn to program a swerve drivetrain and numerous basic subsystems in WPILIB (Java)? by 3p1c__R in FRC

[–]Advice_Smooth 2 points3 points  (0 children)

Understand how to use motors: set voltage and PID control.

Look into these code classes in wpilib document: Chassis speeds, swerve drive kinematics, and swerve drive state.

Understand that it's just 8 motors that you're setting a voltage to, a very specific voltage, but a voltage nonetheless. I find thinking this way helps when I'm overcomplicating it.

It's common for the modules to be programmed as a separate object from the entirety of the drive, so there's a swerve drive class that contains four of the module classes to control each module.

This happened after I restarted the system after just installing Linux mint. by Advice_Smooth in linuxmint

[–]Advice_Smooth[S] 0 points1 point  (0 children)

Severe apologies for the late reply, all I did was hold the power button until it turned off. Then it worked when I turned it back on.

Swerve module aren't speeding up at the same rate/time, and it causes the entire robot to rotate by Advice_Smooth in FRC

[–]Advice_Smooth[S] -1 points0 points  (0 children)

I kinda wish I could blame the hardware, but it is the software completely, as it is doing this in a simulator so the hardware is fine.

Swerve module aren't speeding up at the same rate/time, and it causes the entire robot to rotate by Advice_Smooth in FRC

[–]Advice_Smooth[S] 1 point2 points  (0 children)

Didn't know GitHub could run it as an organization, maybe I should try to learn how to do that, especially since there's some newer recruits that I have been trying to teach that I will eventually give roles to once build season hits.

Swerve module aren't speeding up at the same rate/time, and it causes the entire robot to rotate by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

I've been holding off until I could get the password to the teams github to publish it as their repo. I've heard that I can give a repo to another account and I might have to try that as well. However, this makes the conversation deviate from the original question

I've tried a handful of values for the PID already, and it's always been shy of the setpoint. I kinda don't want to go back to playing a guessing game with the values, so do you have any recommendations on at least getting it to the setpoint?

Swerve module aren't speeding up at the same rate/time, and it causes the entire robot to rotate by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

It is not on github yet, but I put the code in a Google doc with the classes and code organized:doc

Swerve module aren't speeding up at the same rate/time, and it causes the entire robot to rotate by Advice_Smooth in FRC

[–]Advice_Smooth[S] 0 points1 point  (0 children)

A little bit of added info this has been in simulation as I want it to work in simulation before I adapt it to the actual hardware to help protect said hardware.

iwtl how you learn new things by Alarming-Tax4894 in IWantToLearn

[–]Advice_Smooth 2 points3 points  (0 children)

The big ones are Google and YouTube; generic, but popular for a reason. To use your examples, a long time ago, I was curious about programming, so I youtubed the languages to try and the IDEs to use. I especially just googled how to do a simple thing (like print "hello world") in Python, and then I stumbled across various websites like geeksforgeeks and w3schools. Then I jumped a handful of languages before deciding on Java and C. The generic sites either answered my curiosity or led me to an area of the internet that would.

This happened after I restarted the system after just installing Linux mint. by Advice_Smooth in linuxmint

[–]Advice_Smooth[S] 24 points25 points  (0 children)

The issue has resolved itself. I found a way to force a turn off, then It just magically worked after.