Example #1
0
static void control_system_set_motors_ref(struct control_system *UNUSED(am), float d_mm, float theta)
# endif
{
  uint32_t axle_track_mm = position_get_axle_track_mm();

  int32_t right_motor_ref = position_mm_to_ticks(d_mm + (1.0 * axle_track_mm * theta) / 2);
  int32_t left_motor_ref  = position_mm_to_ticks(d_mm - (1.0 * axle_track_mm * theta) / 2);

# ifdef USE_MOTOR_SPEED_CS
  ausbee_cs_set_reference(&(am->csm_right_motor), right_motor_ref);
  ausbee_cs_set_reference(&(am->csm_left_motor), left_motor_ref);
# else
  motors_wrapper_right_motor_set_duty_cycle(NULL, right_motor_ref);
  motors_wrapper_left_motor_set_duty_cycle(NULL, left_motor_ref);
# endif
}
Example #2
0
void control_system_set_left_motor_ref(int32_t ref)
{
  ausbee_cs_set_reference(&(am.csm_left_motor), ref);
}
Example #3
0
void control_system_set_angle_rad_ref(float ref_rad)
{
  ausbee_cs_set_reference(&(am.csm_angle), ref_rad);
}
Example #4
0
void control_system_set_angle_deg_ref(float ref_deg)
{
  float ref_rad = DEG2RAD(ref_deg);
  ausbee_cs_set_reference(&(am.csm_angle), ref_rad);
}
Example #5
0
// User functions
void control_system_set_distance_mm_ref(float ref)
{
  ausbee_cs_set_reference(&(am.csm_distance), ref);
}
Example #6
0
void control_system_set_left_motor_ref(struct control_system *am, int32_t ref)
{
  ausbee_cs_set_reference(&(am->csm_left_motor), ref);
}
Example #7
0
// User functions
void control_system_set_distance_mm_ref(struct control_system *am, float ref)
{
  ausbee_cs_set_reference(&(am->csm_distance), ref);
}