#include <stdio.h>
#include <control_system_manager.h>
Go to the source code of this file.
Defines | |
#define | DEBUG 0 |
#define | debug_printf(args...) do { } while(0) |
Functions | |
void | cs_init (struct cs *cs) |
void | cs_set_consign_filter (struct cs *cs, int32_t(*consign_filter)(void *, int32_t), void *consign_filter_params) |
void | cs_set_correct_filter (struct cs *cs, int32_t(*correct_filter)(void *, int32_t), void *correct_filter_params) |
void | cs_set_feedback_filter (struct cs *cs, int32_t(*feedback_filter)(void *, int32_t), void *feedback_filter_params) |
void | cs_set_process_in (struct cs *cs, void(*process_in)(void *, int32_t), void *process_in_params) |
void | cs_set_process_out (struct cs *cs, int32_t(*process_out)(void *), void *process_out_params) |
int32_t | cs_do_process (struct cs *cs, int32_t consign) |
This function do the main loop of the control system process. | |
void | cs_manage (void *data) |
int32_t | cs_get_out (struct cs *cs) |
int32_t | cs_get_error (struct cs *cs) |
int32_t | cs_get_consign (struct cs *cs) |
int32_t | cs_get_filtered_consign (struct cs *cs) |
int32_t | cs_get_filtered_feedback (struct cs *cs) |
void | cs_set_consign (struct cs *cs, int32_t v) |
#define DEBUG 0 |
Definition at line 24 of file control_system_manager.c.
#define debug_printf | ( | args... | ) | do { } while(0) |
Definition at line 29 of file control_system_manager.c.
Referenced by calc_rays(), complete(), cs_do_process(), intersect_line(), intersect_segment(), is_crossing_poly(), parse(), and parse_num().
int32_t cs_do_process | ( | struct cs * | cs, | |
int32_t | consign | |||
) |
This function do the main loop of the control system process.
Definition at line 183 of file control_system_manager.c.
References cs::consign_filter, cs::consign_filter_params, cs::consign_value, cs::correct_filter, cs::correct_filter_params, debug_printf, cs::error_value, cs::feedback_filter, cs::feedback_filter_params, cs::filtered_consign_value, cs::filtered_feedback_value, i, cs::out_value, cs::process_in, cs::process_in_params, cs::process_out, and cs::process_out_params.
Referenced by cs_manage().
int32_t cs_get_consign | ( | struct cs * | cs | ) |
Return the current consign
Definition at line 264 of file control_system_manager.c.
References cs::consign_value, IRQ_LOCK, and IRQ_UNLOCK.
Referenced by trajectory_finished().
int32_t cs_get_error | ( | struct cs * | cs | ) |
Return the last calculated error
Definition at line 251 of file control_system_manager.c.
References cs::error_value, IRQ_LOCK, and IRQ_UNLOCK.
int32_t cs_get_filtered_consign | ( | struct cs * | cs | ) |
Return the current consign, after filter
Definition at line 275 of file control_system_manager.c.
References cs::filtered_consign_value, IRQ_LOCK, and IRQ_UNLOCK.
Referenced by trajectory_finished().
int32_t cs_get_filtered_feedback | ( | struct cs * | cs | ) |
Return the last feedback value, after filter
Definition at line 286 of file control_system_manager.c.
References cs::filtered_feedback_value, IRQ_LOCK, and IRQ_UNLOCK.
int32_t cs_get_out | ( | struct cs * | cs | ) |
Return the last output sent to process
Definition at line 238 of file control_system_manager.c.
References IRQ_LOCK, IRQ_UNLOCK, and cs::out_value.
void cs_init | ( | struct cs * | cs | ) |
Initiate the control_system structure by setting all fields to NULL
Definition at line 102 of file control_system_manager.c.
References cs::consign_filter, cs::consign_filter_params, cs::consign_value, cs::correct_filter, cs::correct_filter_params, cs::error_value, cs::feedback_filter, cs::feedback_filter_params, IRQ_LOCK, IRQ_UNLOCK, cs::out_value, cs::process_in, cs::process_in_params, cs::process_out, and cs::process_out_params.
void cs_manage | ( | void * | cs | ) |
Apply cs_do_process() to the structure cs
cs | should be a (struct cs*) |
Definition at line 230 of file control_system_manager.c.
References cs::consign_value, and cs_do_process().
void cs_set_consign | ( | struct cs * | cs, | |
int32_t | v | |||
) |
Change the consign without calculating control system
Definition at line 299 of file control_system_manager.c.
References cs::consign_value, IRQ_LOCK, and IRQ_UNLOCK.
Referenced by __trajectory_goto_d_a_rel().
void cs_set_consign_filter | ( | struct cs * | cs, | |
int32_t(*)(void *, int32_t) | consign_filter, | |||
void * | consign_filter_params | |||
) |
Set the cs consign_filter fields in the cs structure
Definition at line 130 of file control_system_manager.c.
References cs::consign_filter, cs::consign_filter_params, IRQ_LOCK, and IRQ_UNLOCK.
void cs_set_correct_filter | ( | struct cs * | cs, | |
int32_t(*)(void *, int32_t) | correct_filter, | |||
void * | correct_filer_params | |||
) |
Set the cs correct_filter fields in the cs structure
Definition at line 141 of file control_system_manager.c.
References cs::correct_filter, cs::correct_filter_params, IRQ_LOCK, and IRQ_UNLOCK.
void cs_set_feedback_filter | ( | struct cs * | cs, | |
int32_t(*)(void *, int32_t) | feedback_filter, | |||
void * | feedback_filer_params | |||
) |
Set the cs feedback_filter fields in the cs structure
Definition at line 151 of file control_system_manager.c.
References cs::feedback_filter, cs::feedback_filter_params, IRQ_LOCK, and IRQ_UNLOCK.
void cs_set_process_in | ( | struct cs * | cs, | |
void(*)(void *, int32_t) | process_in, | |||
void * | process_in_params | |||
) |
Set the cs process_in fields in the cs structure
Definition at line 161 of file control_system_manager.c.
References IRQ_LOCK, IRQ_UNLOCK, cs::process_in, and cs::process_in_params.
void cs_set_process_out | ( | struct cs * | cs, | |
int32_t(*)(void *) | process_out, | |||
void * | process_out_params | |||
) |
Set the cs process_out fields in the cs structure
Definition at line 172 of file control_system_manager.c.
References IRQ_LOCK, IRQ_UNLOCK, cs::process_out, and cs::process_out_params.