File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,6 @@ void loop(){
135135 if (millis ()-tmotor>20 ){
136136 tmotor=millis ();
137137 alvik.updateMotors ();
138- alvik.updateImu ();
139138 msg_size = packeter.packetC2F (' j' , alvik.getRpmLeft (),alvik.getRpmRight ());
140139 alvik.serial ->write (packeter.msg ,msg_size);
141140
Original file line number Diff line number Diff line change @@ -632,3 +632,29 @@ void Arduino_AlvikCarrier::rotate(const float angle){
632632 updateMotors ();
633633}
634634
635+ /*
636+ void Arduino_AlvikCarrier::move(const float distance){
637+ float initial_distance=kinematics->get();
638+ float final_distance=distance+initial_distance;
639+ float error=distance;
640+ unsigned long t=millis();
641+ while(abs(error)>2){
642+ if (millis()-t>20){
643+ t=millis();
644+ updateMotors();
645+ kinematics->inverse(motor_control_left->getRPM(),motor_control_right->getRPM());
646+ kinematics->updatePose();
647+ error=final_distance-kinematics->getTheta();
648+ Serial.println(error);
649+ }
650+ if (error>0){
651+ drive(40,0);
652+ }else{
653+ drive(-40,0);
654+ }
655+ }
656+ drive(0,0);
657+ updateMotors();
658+ */
659+ }
660+
You can’t perform that action at this time.
0 commit comments