View unanswered posts | View active topics It is currently Tue Oct 20, 2020 2:51 am

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Mechanum Wheels Programing
Author Message
Rookie

Joined: Mon May 06, 2013 4:14 pm
Posts: 2
Mechanum Wheels Programing
My team is trying to use the mechanum whells on our robot. We need help as we have figured out there is special programing. What is that special programing?

Kaleb Lange
Team 3281
Techstorm
York, PA

Fri Nov 08, 2013 5:35 pm
Guru

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1523
Re: Mechanum Wheels Programing
An excerpt from our library:
 Code:void DriveMecanumCartesian(    DRIVE &drive,    int x,    int y,    int rot    ){    if (drive.flags & DRIVEF_FOUR_MOTORS)    {        int mag, maxMag, i;        drive.motorPowers[IDX_FRONT_LEFT] = x + y + rot;        drive.motorPowers[IDX_FRONT_RIGHT] = -x + y - rot;        drive.motorPowers[IDX_REAR_LEFT] = -x + y + rot;        drive.motorPowers[IDX_REAR_RIGHT] = x + y - rot;        //        // Normalize        //        maxMag = abs(drive.motorPowers[0]);        for (i = 1; i < MAX_NUM_MOTORS; i++)        {            mag = abs(drive.motorPowers[i]);            if (mag > maxMag)            {                maxMag = mag;            }        }        if (maxMag > MOTOR_MAX_VALUE)        {            for (i = 0; i < MAX_NUM_MOTORS; i++)            {                drive.motorPowers[i] =                    (drive.motorPowers[i]*MOTOR_MAX_VALUE)/maxMag;            }        }    }    else    {        //        // Mecanum drive is only possible with 4 motors. For 2 motors, we        // do arcade drive instead.        //        DriveArcade(drive, y, rot);    }    drive.flags |= DRIVEF_ON;}

Fri Nov 08, 2013 7:40 pm
Display posts from previous:  Sort by
 Page 1 of 1 [ 2 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning