|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
The robnots are already using this I promise.
|
|
#17
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
#suchshot
#sopiston |
|
#18
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
#sonasa
#clingcnthldus #printsohard |
|
#19
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
Add in pneumatic cylinders to the wheels and bumpers, and when the "swag barrier" is broken, have the robot slow down, drop down the back bumper, and lift up the front wheels. Instant thug life rollin'.
|
|
#20
|
|||
|
|||
|
Re: Introducing SwagDrive. The drive code of the future.
any chance we could get a hold of some c++ up in here?
|
|
#21
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
forked. may try to port it to c++ if i get really bored
|
|
#22
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
C:
Code:
//Constants
#define SWAG_BARRIER 0.1
#define SWAG_GAIN 1
#define SWAG_MAX 9000
#define SWAG_PERIOD 500
//Local variables
double old_throttle = 0;
double old_wheel = 0;
double diff_throttle = 0;
double diff_wheel = 0;
double out_throttle;
double out_wheel;
int swag_level = 0;
int swag_period = 0;
//SwagDrive
void SwagDrive(double throttle, double wheel, double* left, double* right)
{
out_throttle = throttle;
out_wheel = wheel;
if(0 == swag_period)
{
diff_throttle = abs(throttle) + abs(old_throttle);
diff_wheel = abs(wheel) + abs(old_wheel);
if(diff_throttle < SWAG_BARRIER)
{
out_throttle = (diff_throttle * SWAG_GAIN) + throttle;
}
else
{
swag_level++;
}
if(diff_wheel < SWAG_BARRIER)
{
out_wheel = (diff_wheel * SWAG_GAIN) + wheel;
}
else
{
swag_level++;
}
if(swag_level > SWAG_MAX)
{
swag_period = SWAG_PERIOD;
swag_level = 0;
}
}
else
{
out_throttle = 0;
out_wheel = 0;
}
//arcade drive
left = out_throttle + out_wheel;
right = out_throttle - out_wheel;
old_throttle = throttle;
old_wheel = wheel;
}
|
|
#23
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
Quote:
|
|
#24
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
I'm going to try this code on a Vex robot and post video!
|
|
#25
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
Quote:
Quote:
|
|
#26
|
|||||
|
|||||
|
Re: Introducing SwagDrive. The drive code of the future.
I heard that the next robot controller can be programmed with lolcode.
|
|
#27
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
It doesn't. We tried it & our robot went straighter. It apparently counteracted our mechanum's natural squirrellyness. It did turn it into a pretty good pusher though.
![]() |
|
#28
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
We modified the code today to provide us with more #YOLO strength. We will be testing this on Thursday, and will hopefully film our results.
|
|
#29
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
I want swagswerve
|
|
#30
|
||||
|
||||
|
Re: Introducing SwagDrive. The drive code of the future.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|