Skip to content

Commit

Permalink
Making API consistent for:
Browse files Browse the repository at this point in the history
1. DiffDriveOdometry.cc
2. DiffDriveOdometry.hh

fix gazebosim#301

Signed-off-by: Akshat Pandya <[email protected]>
  • Loading branch information
akshatpandya committed Dec 24, 2021
1 parent 2a66030 commit 7976b86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/ignition/math/DiffDriveOdometry.hh
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ namespace ignition
/// \param[in] _wheelSeparation Distance between left and right wheels.
/// \param[in] _leftWheelRadius Radius of the left wheel.
/// \param[in] _rightWheelRadius Radius of the right wheel.
public: void SetWheelParams(double _wheelSeparation,
double _leftWheelRadius, double _rightWheelRadius);
public: void SetWheelParams(const double _wheelSeparation,
const double _leftWheelRadius, const double _rightWheelRadius);

/// \brief Set the velocity rolling window size.
/// \param[in] _size The Velocity rolling window size.
Expand Down
12 changes: 6 additions & 6 deletions src/DiffDriveOdometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class ignition::math::DiffDriveOdometryPrivate
/// Runge-Kutta.
/// \param[in] _linear Linear velocity.
/// \param[in] _angular Angular velocity.
public: void IntegrateRungeKutta2(double _linear, double _angular);
public: void IntegrateRungeKutta2(const double _linear, const double _angular);

/// \brief Integrates the velocities (linear and angular) using exact
/// method.
/// \param[in] _linear Linear velocity.
/// \param[in] _angular Angular velocity.
public: void IntegrateExact(double _linear, double _angular);
public: void IntegrateExact(const double _linear, const double _angular);

/// \brief Current timestamp.
public: clock::time_point lastUpdateTime;
Expand Down Expand Up @@ -165,8 +165,8 @@ bool DiffDriveOdometry::Update(const Angle &_leftPos, const Angle &_rightPos,
}

//////////////////////////////////////////////////
void DiffDriveOdometry::SetWheelParams(double _wheelSeparation,
double _leftWheelRadius, double _rightWheelRadius)
void DiffDriveOdometry::SetWheelParams(const double _wheelSeparation,
const double _leftWheelRadius, const double _rightWheelRadius)
{
this->dataPtr->wheelSeparation = _wheelSeparation;
this->dataPtr->leftWheelRadius = _leftWheelRadius;
Expand Down Expand Up @@ -212,7 +212,7 @@ const Angle &DiffDriveOdometry::AngularVelocity() const

//////////////////////////////////////////////////
void DiffDriveOdometryPrivate::IntegrateRungeKutta2(
double _linear, double _angular)
const double _linear, const double _angular)
{
const double direction = *this->heading + _angular * 0.5;

Expand All @@ -223,7 +223,7 @@ void DiffDriveOdometryPrivate::IntegrateRungeKutta2(
}

//////////////////////////////////////////////////
void DiffDriveOdometryPrivate::IntegrateExact(double _linear, double _angular)
void DiffDriveOdometryPrivate::IntegrateExact(const double _linear, const double _angular)
{
if (std::fabs(_angular) < 1e-6)
{
Expand Down

0 comments on commit 7976b86

Please sign in to comment.