C++ Library for the PsiSwarm Robot - Version 0.7
Fork of PsiSwarmV7 by
motors.h@6:b340a527add9, 2016-10-15 (annotated)
- Committer:
- jah128
- Date:
- Sat Oct 15 13:51:39 2016 +0000
- Revision:
- 6:b340a527add9
- Parent:
- 5:3cdd1a37cdd7
Added Apache license to files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jah128 | 0:d6269d17c8cf | 1 | /* University of York Robotics Laboratory PsiSwarm Library: Motor Functions Header File |
jah128 | 0:d6269d17c8cf | 2 | * |
jah128 | 6:b340a527add9 | 3 | * Copyright 2016 University of York |
jah128 | 6:b340a527add9 | 4 | * |
jah128 | 6:b340a527add9 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. |
jah128 | 6:b340a527add9 | 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
jah128 | 6:b340a527add9 | 7 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS |
jah128 | 6:b340a527add9 | 8 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
jah128 | 6:b340a527add9 | 9 | * See the License for the specific language governing permissions and limitations under the License. |
jah128 | 6:b340a527add9 | 10 | * |
jah128 | 0:d6269d17c8cf | 11 | * File: motors.h |
jah128 | 0:d6269d17c8cf | 12 | * |
jah128 | 0:d6269d17c8cf | 13 | * (C) Dept. Electronics & Computer Science, University of York |
jah128 | 0:d6269d17c8cf | 14 | * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis |
jah128 | 0:d6269d17c8cf | 15 | * |
jah128 | 5:3cdd1a37cdd7 | 16 | * PsiSwarm Library Version: 0.7 |
jah128 | 0:d6269d17c8cf | 17 | * |
jah128 | 5:3cdd1a37cdd7 | 18 | * October 2016 |
jah128 | 0:d6269d17c8cf | 19 | * |
jah128 | 0:d6269d17c8cf | 20 | * |
jah128 | 0:d6269d17c8cf | 21 | */ |
jah128 | 0:d6269d17c8cf | 22 | |
jah128 | 0:d6269d17c8cf | 23 | #ifndef MOTORS_H |
jah128 | 0:d6269d17c8cf | 24 | #define MOTORS_H |
jah128 | 0:d6269d17c8cf | 25 | |
jah128 | 0:d6269d17c8cf | 26 | void set_left_motor_speed(float speed); |
jah128 | 0:d6269d17c8cf | 27 | void set_right_motor_speed(float speed); |
jah128 | 0:d6269d17c8cf | 28 | void brake_left_motor(void); |
jah128 | 0:d6269d17c8cf | 29 | void brake_right_motor(void); |
jah128 | 0:d6269d17c8cf | 30 | void brake(void); |
jah128 | 0:d6269d17c8cf | 31 | void stop(void); |
jah128 | 0:d6269d17c8cf | 32 | void forward(float speed); |
jah128 | 0:d6269d17c8cf | 33 | void backward(float speed); |
jah128 | 0:d6269d17c8cf | 34 | void turn(float speed); |
jah128 | 0:d6269d17c8cf | 35 | |
jah128 | 0:d6269d17c8cf | 36 | // New time based functions (library v0.3) |
jah128 | 0:d6269d17c8cf | 37 | void time_based_forward(float speed, int microseconds, char brake); |
jah128 | 0:d6269d17c8cf | 38 | void time_based_turn(float speed, int microseconds, char brake); |
jah128 | 0:d6269d17c8cf | 39 | int time_based_turn_degrees(float speed, float degrees, char brake); |
jah128 | 0:d6269d17c8cf | 40 | float get_maximum_turn_angle(int microseconds); |
jah128 | 0:d6269d17c8cf | 41 | int get_time_based_turn_time(float speed, float degrees); |
jah128 | 0:d6269d17c8cf | 42 | void IF_check_time_for_existing_time_based_action(); |
jah128 | 0:d6269d17c8cf | 43 | void IF_end_time_based_action(); |
jah128 | 0:d6269d17c8cf | 44 | |
jah128 | 0:d6269d17c8cf | 45 | void IF_update_motors(); |
jah128 | 4:1c621cb8cf0d | 46 | float IF_calibrated_left_speed(float speed); |
jah128 | 4:1c621cb8cf0d | 47 | float IF_calibrated_right_speed(float speed); |
jah128 | 0:d6269d17c8cf | 48 | float IF_calibrated_speed(float speed); |
jah128 | 0:d6269d17c8cf | 49 | void IF_init_motors(void); |
jah128 | 0:d6269d17c8cf | 50 | |
jah128 | 0:d6269d17c8cf | 51 | #endif |