|
SourceCodeInformation
#discussions on the source code Many thanks to Jesse DeGuire, Nathan Sprague for the library COIL that allows simple programmatic control of the iRobotGetting the source codeThe source code is the SVN tree linked from: http://code.google.com/p/sparkyrobotcontroller/source/checkout controldOnce you have downloaded the code, go to: /sparkyrobotcontroller/irobot/sparky This is where controld.c lives. Supporting more movements / beeps /etcYou will want to edit the function move_dir(char action, HDF config) Here is where your code reading abilities will be put to the test since I have been sloppy. When a text message arrives on the robot, the contents of the command are the "action" argument passed to move_dir. move_dir originally (in older versions with the MakeBoard) would match the "action" string with the movement commands in config.hdf, then set the left and right servos to the values of: movement..0 movement..1 respectively. However, with the iRobot and the joystick, we wanted fine tune control of the motors. So now, SparkyJoystick (which you are also free to modify) sends movement commands like this: move_DIRECTION_L_VALUE_R_VALUE for example: move_straight_L_50_R_75 means crank the left motor to 50% and the right motor to 75% and set the turning radius to 0. At the end of move_dir, the call drive(velocity, radius); actually tells the robot to move. Now the question is how to add commands. Maybe add support for radius to be sent like: move_straight_L_50_R_75_RA_1 or add some commands that beep or play music :-) Allowing customization via control.hdf is tricky since support needs to exist in the controld and SparkyJoystick software anyhow. SparkyJoystickSparkyJoystick is an XCode project and is also located in the SVN tree. |
Sign in to add a comment