X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fdevices%2Frobot%2Fblocking_detection_manager%2Fblocking_detection_manager.h;h=4afce0908ca013b188376d4242afa952b64d057f;hp=27b789722c2bf34bc0a5b9a9c891fa204ed8349e;hb=bf5060a8c2deade2516d1cfeccae7137e740b4c4;hpb=876789a372da2e93a816428649e511c2ad9e40be diff --git a/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h b/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h index 27b7897..4afce09 100644 --- a/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h +++ b/modules/devices/robot/blocking_detection_manager/blocking_detection_manager.h @@ -1,6 +1,6 @@ -/* +/* * Copyright Droids Corporation (2007) - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -30,14 +30,14 @@ #include -/* detect blocking based on motor current. +/* detect blocking based on motor current. * triggers the blocking if: - * - the current in the motor is a above a threshold + * - the current in the motor is a above a threshold * during n tests * - the speed is below the threshold (if specified) * * We suppose that i = k1.V - k2.w - * (V is the voltage applied on the motor, and w the current speed + * (V is the voltage applied on the motor, and w the current speed * of the motor) */ @@ -59,34 +59,34 @@ struct blocking_detection { }; /** init module, give the cs as parameter */ -void bd_init(struct blocking_detection * bd); +void bd_init(struct blocking_detection *bd); -/** thresholds for current-based blocking detection. If cpt_thres +/** thresholds for current-based blocking detection. If cpt_thres * is 0, disable it. */ -void bd_set_current_thresholds(struct blocking_detection * bd, - int32_t k1, int32_t k2, +void bd_set_current_thresholds(struct blocking_detection *bd, + int32_t k1, int32_t k2, uint32_t i_thres, uint16_t cpt_thres); /** speed threshold: if speed is above it, disable - * blocking_detection. */ -void bd_set_speed_threshold(struct blocking_detection * bd, + * blocking_detection. */ +void bd_set_speed_threshold(struct blocking_detection *bd, uint16_t speed); /** reset the blocking */ -void bd_reset(struct blocking_detection * bd); +void bd_reset(struct blocking_detection *bd); -/** function to be called periodicallyn, when we use cs structure */ -void bd_manage_from_cs(struct blocking_detection * bd, struct cs *cs); +/** function to be called periodically, when we use cs structure */ +void bd_manage_from_cs(struct blocking_detection *bd, struct cs *cs); /** function to be called periodically, when we use values directly */ -void bd_manage_from_pos_cmd(struct blocking_detection * bd, +void bd_manage_from_pos_cmd(struct blocking_detection *bd, int32_t pos, int32_t cmd); /** function to be called periodically, when we use values directly */ -void bd_manage_from_speed_cmd(struct blocking_detection * bd, +void bd_manage_from_speed_cmd(struct blocking_detection *bd, int32_t speed, int32_t cmd); /** get value of blocking detection */ -uint8_t bd_get(struct blocking_detection * bd); +uint8_t bd_get(struct blocking_detection *bd); #endif