Skip to content

Conversation

@PhyXTGears-1720
Copy link
Member

-Nick Q

Also add armPose and point header files
Yo sontraen onidgon
- Emmie Jones
Heeyaw
- Emmie J
2D points use 0.0 as their Z axis values

VrOOOOoOoOommM
- Emmie Jones
hEehOO Add tHe .0
- Emmie Jones
"Where are your arms?" - Us, 2023
- Emmie Jones
"Remember when you tried to kill me twice?"
- Emmie Jones
yeehaw heeyaw
- Emmie Jones
"I was chosen for the constitutional convention!"
- Emmie Jones
"AAAAAAAAAVVVVVVVVVEEEEEEEEE MARRRIIIIAAAAA"
- Emmie Jones
Initial IK only focused on shoulder and elbow joints on a single plane.
Add support for turret angle.

- Emmie Jones
Use correct method names. add override keyword for compiler checking.
add virtual for base class methods.

yeehaw
- Emmie Jones
Yeeyee
- Emmie Jones
(Because Justin said so but doesn't know why)

"Double double double"
- Emmie Jones
yee
- Emmie Jones
weehaw
- Emmie Jones
We Are Toast
- Emmie Jones
- Add MoveToIntakeCommand.
- Add boundary classes.
- Add no-go zones.
- Define no-go zones.
- Add safety points.
- Add reach points.

- Emmie Jones
Because Justin said so.

- Emmie Jones
- Justin C and Emmie Jones
* master: (34 commits)
  Reformat
  Fix: Left trigger slows and right trigger speeds up drive
  Add comments
  commands: add drivetrain subsystem requirement to DriveTeleopCommand
  Kill program if unable to open config.toml
  Fix: build fails when catching exception by value
  build: Make gradlew executable
  git: ignore gradle.properties for local overrides
  add file name to toml load error message
  change input limiter to accept all values of max and min from the constants file
  change m_drivetrain to c_drivetrain in driveTeleopCommand
  add drive command to robot
  add teleop driving command
  add subsystems and HIDs to the robot class
  add Xbox Controller USB interface constants to Interfaces
  bugfix: change the scope to reset the navX heading to the global scope
  add enabling/disabling odometry calculation functions
  add odometry logic
  add base code for odometry
  add getter functions for the individual swerve module sensors
  ...
Turn wheels to form an X and resist shoves or sliding.

- Nick Q
Arm teleop was moving the target position kilometers away due to
exhaustion induced programming errors merging two incompatible concepts
into an incorrect implementation.

Rewrite to focus on one concept: compute various offsets, then add to
current target position.

- Nick Q and Justin C
When arm teleop command is rescheduled, it will continue moving to the
previous target.  Add method so the command can be reset to hold at the
current arm position, not just at initialization.

- Nick Q
Try to avoid further destruction of the arm by reducing the max current
limits.

- Justin C
@PhyXTGears-1720
Copy link
Member Author

PhyXTGears-1720 commented Mar 14, 2023

NOTE: this includes the code from the features/arm branch

-Nick Q

@PhyXTGears-1720
Copy link
Member Author

Added myself because I still need to review arm code

-Nick Q

Comment on lines +11 to +14
const double k_maxPointSpeed = 0.005;
const double k_maxPointRotSpeed = (2.0 * M_PI / 10.0) * 0.02; // radians per second in 20ms.
const double k_maxWristRotSpeed = (2.0 * M_PI / 2.0) * 0.02;
const double k_maxGripSpeed = 0.1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go in the Constants.h file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These constants aren't meant to be shared with an other parts of the program. I had concerns that someone might be inclined to reuse them for another purpose and have cause to change them.

I'm inclined to leave this for the competition as it's tested, and change it after.

Copy link
Collaborator

@nickquednow nickquednow Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. is there a possibility after competition to rename it to be c_ to clarify that it is not intended to be a global constant?

Copy link
Collaborator

@nickquednow nickquednow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most looks good to me. There was only one major thing in there (it involved overloading a function), but other than that, looks good for the arm code.

double leftX = c_operatorController->GetLeftX();
// Square input to improve fidelity.
leftX = DEADZONE(leftX);
leftX = std::copysign(std::clamp(leftX * leftX, -1.0, 1.0), leftX);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use std::pow(leftX,2) here (consistency).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's doesn't matter to me. Either way gets the point across. I'd like to think the c++ compiler is smart enough to convert a function call into a single equivalent multiplication, but I couldn't say for sure.

Comment on lines +11 to +14
const double k_maxPointSpeed = 0.005;
const double k_maxPointRotSpeed = (2.0 * M_PI / 10.0) * 0.02; // radians per second in 20ms.
const double k_maxWristRotSpeed = (2.0 * M_PI / 2.0) * 0.02;
const double k_maxGripSpeed = 0.1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review :)

double gripMag = std::sqrt(std::pow(m_target.x,2)+std::pow(m_target.y,2));
double gripDir = std::atan2(m_target.x, m_target.y); // 0 deg == y axis

// Rotate turret. Speed of rotation is reduced the further the arm reaches.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we move the second comment to line 44?

double rightY = -c_operatorController->GetRightY(); /* Invert so + is up */
// Square input to improve fidelity.
rightY = DEADZONE(rightY);
rightY = std::copysign(std::clamp(rightY * rightY, -1.0, 1.0), rightY);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we put std::pow(rightY,2) here?

@boxofrox
Copy link
Collaborator

We're three days before a competition. I've got more commits in feature/arm that were tested last night that need to be merged as well.

The concerns here with files related to the arm system will be fixed later in a separate commit. I don't have the time to fix these now, merge this, rebase/merge feature/arm and resolve conflicts due to renames, review to merge feature/arm into master, and test on the robot to make sure nothing broke.

StartEndCommand used by autonomous.

- Justin C
@nickquednow
Copy link
Collaborator

Due to the "fix later" issue, I will approve the changes and go ahead and approve the pull request (after the arm fixes have been merged and tested). I will just put the things into a new issue on GH.

Copy link
Collaborator

@nickquednow nickquednow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was only 1 odd thing I saw in robot.h other than that, it looks good.

@PhyXTGears-1720 PhyXTGears-1720 merged commit 2f5c48e into master Mar 22, 2023
@boxofrox
Copy link
Collaborator

Due to the "fix later" issue, I will approve the changes and go ahead and approve the pull request (after the arm fixes have been merged and tested). I will just put the things into a new issue on GH.

I already opened an issue referencing this. All of the individual "will fix later" is addressed in the feature/arm branch, which I've since merged. The stuff that I didn't mark in here as "will fix later" still needs to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants