Hey guys, so my team recently got our new mecanum Wheels and we went on programming the wheels so they could strafe and do cool stuff like that. But we were having some problems that when we strafed, the bot would kind of turn and swing a bit, which is confusing and this is same when driving backwards. I dont know if its a mechanical Problem or a Driving Problem but here is the code we have tried till now
if ((fabs(controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y)) + fabs(controller.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y))) > (fabs(controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_X)) + fabs(controller.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_X)))) {
set_drive((powf(controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y), 3)) / powf(127, 2), (powf(controller.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y), 3)) / powf(127, 2));
} else {
strafe(controller.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_X));
strafe(-controller.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_X));
}
and
drive_right = controller.get_analog(ANALOG_LEFT_Y) - controller.get_analog(ANALOG_RIGHT_X) - controller.get_analog(ANALOG_LEFT_X);
drive_right_b = controller.get_analog(ANALOG_LEFT_Y) - controller.get_analog(ANALOG_RIGHT_X) + controller.get_analog(ANALOG_LEFT_X);
drive_left = controller.get_analog(ANALOG_LEFT_Y) + controller.get_analog(ANALOG_RIGHT_X) + controller.get_analog(ANALOG_LEFT_X);
drive_left_b = controller.get_analog(ANALOG_LEFT_Y) + controller.get_analog(ANALOG_RIGHT_X) - controller.get_analog(ANALOG_LEFT_X);
so if you find something which is done wrong please let me know and if you could provide a sample of the opcontrol code for mecanum wheels that would be helpful as well.
(also please try not to say that this post or that post has good info, i have already looked at many posts related to mecanum wheels but i didnt find anything useful but if you find a post which has a lot of info please do post it here)
Thanks!!