Revision 259aaff8

View differences:

scout/encoders/src/encoders.cpp
93 93
                           ::messages::query_encoders::Response &res)
94 94
{
95 95
    /* Put index, velocity, and distance data in message */
96
    res.fl_distance = encoder_fl.get_ticks();
96
    res.fl_distance = -encoder_fl.get_ticks();
97 97
    res.fr_distance = encoder_fr.get_ticks();
98 98
    res.bl_distance = encoder_bl.get_ticks();
99 99
    res.br_distance = encoder_br.get_ticks();
scout/libscout/src/test_behaviors/Odometry_new.cpp
30 30
  motor_bl_ticks_iter = scout_enc.bl_ticks - motor_bl_ticks_last;
31 31
  motor_br_ticks_iter = scout_enc.br_ticks - motor_br_ticks_last;
32 32
  
33
  // update the 
34
  motor_fl_ticks_last = scout_enc.fl_ticks;
35
  motor_fr_ticks_last = scout_enc.fr_ticks;
36
  motor_bl_ticks_last = scout_enc.bl_ticks;
37
  motor_br_ticks_last = scout_enc.br_ticks;
33 38

  
34 39
  avg_left_ticks = (float) motor_fl_ticks_iter;
35 40
  avg_right_ticks = (float) motor_fr_ticks_iter;
......
73 78
  scout_pos->y += loop_time/6 * (k01+2*(k11+k21)+k31);
74 79
  scout_pos->theta += loop_time/6 * (k02+2*(k12+k22)+k32);
75 80

  
76
  // update the 
77
  motor_fl_ticks_last = scout_enc.fl_ticks;
78
  motor_fr_ticks_last = scout_enc.fr_ticks;
79
  motor_bl_ticks_last = scout_enc.bl_ticks;
80
  motor_br_ticks_last = scout_enc.br_ticks;
81 81

  
82 82
}
83 83

  
......
90 90
  //Rate r(LOOP_RATE); 
91 91
  Duration r = Duration(LOOP_TIME);
92 92

  
93
  motors->set_sides(50,50, MOTOR_ABSOLUTE);
93
  motors->set_sides(-50,50, MOTOR_ABSOLUTE);
94 94

  
95 95
  while(ok())
96 96
  {
scout/libscout/src/test_behaviors/Odometry_new.h
8 8
#include "messages/ScoutPosition.h"
9 9

  
10 10
#define WHEEL_R 0.025 //this is a virtual unit now... use real values
11
#define WHEEL_B 0.105  // this is a virtual unit now... use real values
11
#define WHEEL_B 0.115  // this is a virtual unit now... use real values
12 12
#define TICKS_PER_REV 48
13 13
#define RAD_PER_TICK (2*M_PI/TICKS_PER_REV)
14 14
#define LOOP_RATE 10 // Hz, integrate 10 times per second

Also available in: Unified diff