Tags:
create new tag
view all tags
-Yi downloaded the robotC program, and while this happened Phil and David began work on the doSquare and doCircle functions (respectively)

-Yi then configured each wheel motor (placed in ports 2-5) to the r obotC program using the built in wheel assignment tool, assigning them easy to understand names (leftForward, rightForward, leftBack, rightBack)

-Since the doCircle function only required changing the speed of each motor rather then multiple functions in one like the doSquare, David and Phil worked on the doSquare function.

-The functions moveForwardForTime and rotateForTime were made using the examples provided in class, changing the motors used to adhere to the ones defined by Yi.

-The main task was designed using the example provided in class, only adding our stopMotor function to the code

-First we attempted our doSquare function, without using any of the doCircle code. This was done because we found the doSquare to be more difficult to create and we wanted to make sure we had it working correctly before implementing the easier code. The steps of the doSquare process were as follows

1. The code was downloaded to the cortex. The code at this point only involved one implementation of moveForwardForTime and rotateForTime (as opposed to the 4 implementations of each used in the final code), just to see if it would do these functions when the button on the controller was pressed.

2. The functions performed correctly, but when they completely the tumbler would rotate in place nonstop. We are not sure why it did this but we found a way to easily stop this (detailed in step 3).

3. Since the functions worked correctly we rewrote the doSquare function to inculde the four implementations needed to complete a square, guessing on the speeds that would be needed to make it complete the square. To stop the infinite rotation we encountered, we made our stopMotor function to stop the wheels completely and placed it inside the rotateForTime function. This would ensure that the tumbler would stop completely before moving on the next moveForwardForTime function, before stopping completely when the last rotateForTime was called.

4. The speeds were reset to make sure a square was created.

-After this, all that had to be done was to add the doCircle function, which had already been created, to the code and the main task, assigning it a button.

-The speed was initially off for the doCircle, but after a quick fix it was set to complete a circle.

RobotCCode

<meta name="robots" content="noindex" />

-- (c) Fordham University Robotics and Computer Vision

Topic revision: r1 - 2013-03-25 - DavidWalsh
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback