So I've had my Vex for a while and I just this evening purchased RobotC and a few new Vex parts. I'm ready to start playing around (I'm 30 years old, so not in any competitions or anything), but I thought I'd see if I needed to re-invent the wheel or something.

All of the demo code for RobotC is very specific purpose, but I've been thinking I'd like to start by creating some general use code.

For example, given the diameter of driven wheels, gear reduction and wheel base it should be pretty easy to create a few useful functions such as...

Has anyone done something like this yet? My google searches are not turning up much useful information.

Sat Aug 30, 2008 2:31 am

fryfrog

Rookie

Joined: Sat Aug 30, 2008 2:25 amPosts: 25

Re: Is there a library of useful functions anywhere?

Here is what I have so far. I'm having a hard time with the turning X degrees because I suck at math. I just need to figure out how to take the distance traveled (measured by the sensors), compare that with the known turning circle (because we know the wheel base) and then turn that into degrees.

For example, a 10cm wheel base with 3cm wheels means traveling ~5cm is 90 degrees. How do I make that into an equation! I'll figure it out i'm sure, but if anyone wants to take a look at what I'm doing so far... feed back is welcome.

/*****************************************************************************//* Title: Useful Robot Movement Functions for Skid Steer Robots *//* Description: A collection of functions designed to provide useful *//* locomotion to a robot that uses skid steering to drive. *//* All length measurements are in centimeters and speed in -127 to 127 *//* For proper use, motors and encoders should be named as follows: *//* leftMotor, rightMotor, leftEncoder, rightEncoder *//*****************************************************************************/

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