create_drive_straight(200);// starts moving the Create
sleep(5);// wait for the Create to move; you could also use the Create's distance sensors if you want better accuracy
create_stop();// stop the Create
bmd(0);// wait for the motor to move
// At this point the Create and motor have both moved and are stopped.
-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS
No problem. :-) By the way, welcome to the Botball Community!
-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS
Thanks, and I have programmed the robot (CBC robot) to use its motors to move and then stop, then the servos move the claw to collect the Kelp then move the motors toward the next Kelp. But when the robot runs the servos close the claw and move toward the next set of kelp at the same time. How can I make it so that they go in order?
I'm assuming you are just using a set_servo_position to move your servo and then following it up with your nav code. set_servo_position does not wait for the servo to slew/rotate to the desired position. I would place an msleep(500) or something like that after the set_servo_position so that way the servo will be in the desired position before moving.
Try this:
-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS
Thank you very much, the robot works great.
~ARIGATO
-From firetiger5
~ARIGATO
-From firetiger5
No problem. :-) By the way, welcome to the Botball Community!
-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS
Thanks, and I have programmed the robot (CBC robot) to use its motors to move and then stop, then the servos move the claw to collect the Kelp then move the motors toward the next Kelp. But when the robot runs the servos close the claw and move toward the next set of kelp at the same time. How can I make it so that they go in order?
~ARIGATO
-From firetiger5
I'm assuming you are just using a set_servo_position to move your servo and then following it up with your nav code. set_servo_position does not wait for the servo to slew/rotate to the desired position. I would place an msleep(500) or something like that after the set_servo_position so that way the servo will be in the desired position before moving.