Changeset 30:4914ca6162bb in rrlib_data_fusion


Ignore:
Timestamp:
30.07.2014 15:07:33 (7 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Children:
31:2a82a3637cae, 33:7ec2c25f43b2, 37:b821255060a6
Phase:
public
Message:

Adapted to changes in rrlib_math

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tAverage.h

    r28 r30  
    187187    } 
    188188    double factor = 1.0 / channels.size(); 
    189     return math::tPose2D(accumulated_position * factor, accumulated_yaw * factor); 
     189    return math::tPose2D(accumulated_position * factor, math::tAngleRad(accumulated_yaw * factor)); 
    190190  } 
    191191 
     
    231231    } 
    232232    double factor = 1.0 / channels.size(); 
    233     return math::tPose3D(accumulated_position * factor, accumulated_roll * factor, accumulated_pitch * factor, accumulated_yaw * factor); 
     233    return math::tPose3D(accumulated_position * factor, math::tAngleRad(accumulated_roll * factor), math::tAngleRad(accumulated_pitch * factor), math::tAngleRad(accumulated_yaw * factor)); 
    234234  } 
    235235 
  • tWeightedAverage.h

    r28 r30  
    244244    } 
    245245    double factor = 1.0 / accumulated_weights; 
    246     return math::tPose2D(accumulated_position * factor, accumulated_yaw * factor); 
     246    return math::tPose2D(accumulated_position * factor, math::tAngleRad(accumulated_yaw * factor)); 
    247247  } 
    248248 
     
    307307    } 
    308308    double factor = 1.0 / accumulated_weights; 
    309     return math::tPose3D(accumulated_position * factor, accumulated_roll * factor, accumulated_pitch * factor, accumulated_yaw * factor); 
     309    return math::tPose3D(accumulated_position * factor, math::tAngleRad(accumulated_roll * factor), math::tAngleRad(accumulated_pitch * factor), math::tAngleRad(accumulated_yaw * factor)); 
    310310  } 
    311311 
  • tWeightedSum.h

    r28 r30  
    220220    } 
    221221 
    222     return math::tPose2D(accumulated_position, accumulated_yaw); 
     222    return math::tPose2D(accumulated_position, math::tAngleRad(accumulated_yaw)); 
    223223  } 
    224224 
     
    274274    } 
    275275 
    276     return math::tPose3D(accumulated_position, accumulated_roll, accumulated_pitch, accumulated_yaw); 
     276    return math::tPose3D(accumulated_position, math::tAngleRad(accumulated_roll), math::tAngleRad(accumulated_pitch), math::tAngleRad(accumulated_yaw)); 
    277277  } 
    278278 
  • tests/test.cpp

    r29 r30  
    9999  { 
    100100    std::vector<math::tPose2D> data; 
    101     data.push_back(math::tPose2D(0.4, 0.4, 0.4)); 
    102     data.push_back(math::tPose2D(0.1, 0.1, 0.1)); 
    103     data.push_back(math::tPose2D(0.2, 0.2, 0.2)); 
    104     data.push_back(math::tPose2D(0.5, 0.5, 0.5)); 
    105     data.push_back(math::tPose2D(0.8, 0.8, 0.8)); 
     101    data.push_back(math::tPose2D(0.4, 0.4, math::tAngleRad(0.4))); 
     102    data.push_back(math::tPose2D(0.1, 0.1, math::tAngleRad(0.1))); 
     103    data.push_back(math::tPose2D(0.2, 0.2, math::tAngleRad(0.2))); 
     104    data.push_back(math::tPose2D(0.5, 0.5, math::tAngleRad(0.5))); 
     105    data.push_back(math::tPose2D(0.8, 0.8, math::tAngleRad(0.8))); 
    106106    assert(data.size() == cNUMBER_OF_SAMPLES); 
    107107 
    108     RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.1, 0.1, 0.1), FuseValuesUsingMaximumKey<math::tPose2D>(data.begin(), data.end(), keys, keys + cNUMBER_OF_SAMPLES))); 
     108    RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.1, 0.1, math::tAngleRad(0.1)), FuseValuesUsingMaximumKey<math::tPose2D>(data.begin(), data.end(), keys, keys + cNUMBER_OF_SAMPLES))); 
    109109 
    110     RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.4, 0.4, 0.4), FuseValuesUsingAverage<math::tPose2D>(data.begin(), data.end()))); 
    111     RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.3, 0.3, 0.3), FuseValuesUsingWeightedAverage<math::tPose2D>(data.begin(), data.end(), keys, keys + cNUMBER_OF_SAMPLES))); 
    112     RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.4, 0.4, 0.4), FuseValuesUsingMedianVoter<math::tPose2D>(data.begin(), data.end()))); 
     110    RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.4, 0.4, math::tAngleRad(0.4)), FuseValuesUsingAverage<math::tPose2D>(data.begin(), data.end()))); 
     111    RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.3, 0.3, math::tAngleRad(0.3)), FuseValuesUsingWeightedAverage<math::tPose2D>(data.begin(), data.end(), keys, keys + cNUMBER_OF_SAMPLES))); 
     112    RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.4, 0.4, math::tAngleRad(0.4)), FuseValuesUsingMedianVoter<math::tPose2D>(data.begin(), data.end()))); 
    113113 
    114114    math::tPose2D result = FuseValuesUsingMedianKeyVoter<math::tPose2D>(data.begin(), data.end(), keys, keys + cNUMBER_OF_SAMPLES); 
    115     RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.2, 0.2, 0.2), result) || IsEqual(math::tPose2D(0.5, 0.5, 0.5), result)); 
     115    RRLIB_UNIT_TESTS_ASSERT(IsEqual(math::tPose2D(0.2, 0.2, math::tAngleRad(0.2)), result) || IsEqual(math::tPose2D(0.5, 0.5, math::tAngleRad(0.5)), result)); 
    116116  } 
    117117 
Note: See TracChangeset for help on using the changeset viewer.