-
Notifications
You must be signed in to change notification settings - Fork 0
A test of simpler code #46
base: Swingy-Arm
Are you sure you want to change the base?
Conversation
Fixed a lot of stuff.
|
we prob still need to add the run loop maybe 4 like antigrav or smth idk |
|
Also need to transfer new PID values |
| } | ||
|
|
||
| if(value + doubleDeadZone < altEncoder1.getSensorPosition() && value - doubleDeadZone > altEncoder1.getSensorPosition()){ | ||
| if(value + doubleDeadZone < altEncoder1.getPosition() && value - doubleDeadZone > altEncoder1.getPosition()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the deadzone comparison are swapped. should be
value + doubleDeadZone > altEncoder1.getPosition() && value - doubleDeadZone < altEncoder1.getPosition()so i think the antigrav case is never selected. either remove this or fix it (in which case i think you'll need to fix the value of doubleDeadZone - see my comment above)
|
|
||
| if(value + doubleDeadZone < altEncoder2.getSensorPosition() && value - doubleDeadZone > altEncoder2.getSensorPosition()){ | ||
| if(value + doubleDeadZone < altEncoder2.getPosition() && value - doubleDeadZone > altEncoder2.getPosition()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue here - the comparisons are swapped
|
|
||
| if(value + doubleDeadZone < altEncoder1.getSensorPosition() && value - doubleDeadZone > altEncoder1.getSensorPosition()){ | ||
| if(value + doubleDeadZone < altEncoder1.getPosition() && value - doubleDeadZone > altEncoder1.getPosition()){ | ||
| getAntiGravFirstJoint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be antiGravFirstJoint(); so that the antigrav is actually applied (getAntiGravFirstJoint() just calculates the amount of power to set, but doesn't actually apply it to the motor controller)
| */ | ||
|
|
||
| //This is our portion with antigrav | ||
| // These next 3 antiGrav aren't used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix this comment: these are used
| if(value + doubleDeadZone < altEncoder2.getSensorPosition() && value - doubleDeadZone > altEncoder2.getSensorPosition()){ | ||
| if(value + doubleDeadZone < altEncoder2.getPosition() && value - doubleDeadZone > altEncoder2.getPosition()){ | ||
| getAntiGravSecondJoint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above - i think this should be antiGravSecondJoint();
|
|
||
| } | ||
|
|
||
| // These next 2 antiGravs are used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix this comment: betterGetAntiGravFirstJoint is not used
Fixed per ryans pr comment
So this lets antigrav work!
| //HIGH NODE SCORING | ||
| Robot.arms.pidForArmOne(-38.34); | ||
| Robot.arms.pidForArmTwo(-90.665); | ||
| Robot.arms.checkJointTwo(-90.665); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this call should've been in the pidForArmX
So basically this is 1241 am and i am putting this pr out so you guys can take a look especially James because i know that he is usually up late so yeah please take a look and hopefully this code wont kill anything because i actually concentrated while writing this.