Skip to content

Commit

Permalink
Rename relative orientation for azimuth (#61)
Browse files Browse the repository at this point in the history
* Rename relOrientation for azimuth

* fix build

* Update common.cmake
  • Loading branch information
cquesnel authored Oct 7, 2021
1 parent c70e034 commit 3cbc543
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cmake/pheromones/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function(pheromones_fetch_populate)
${PROJECT_NAME}_pheromones

GIT_REPOSITORY https://github.com/SwarmUS/Pheromones
GIT_TAG 108ff07
GIT_TAG 9a45eef
GIT_PROGRESS TRUE
)

Expand Down
16 changes: 8 additions & 8 deletions src/pheromones/include/pheromones/NeighborPositionDTO.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class NeighborPositionDTO {
public:
NeighborPositionDTO(const NeighborPosition& pos);
NeighborPositionDTO(float distance, float relativeOrientation, bool inLOS);
NeighborPositionDTO(float distance, float azimuth, bool inLOS);

/**@brief get the distance
*@return the distance in meters*/
Expand All @@ -16,17 +16,17 @@ class NeighborPositionDTO {
*@return true if the robot is in LOS*/
bool inLOS() const;

/**@brief get the relative orientation
*@return the orientation in degrees*/
float getRelativeOrientation() const;
/**@brief get the azimuth
*@return the azimuth*/
float getAzimuth() const;

/**@brief get the distance
*@param distance the distance in meters*/
void setDistance(float distance);

/**@brief set the relative orientation
*@param orientation the orientation in degrees*/
void setRelativeOrientation(float orientation);
/**@brief set the azimuth
*@param azimuth the azimuth in degrees*/
void setAzimuth(float azimuth);

/**@brief set if the robot is in LOS
*@param inLOS if the robot is in LOS*/
Expand All @@ -41,7 +41,7 @@ class NeighborPositionDTO {

private:
float m_distance;
float m_relativeOrientation;
float m_azimuth;
bool m_inLOS;
};

Expand Down
16 changes: 6 additions & 10 deletions src/pheromones/src/NeighborPositionDTO.cpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
#include "NeighborPositionDTO.h"

NeighborPositionDTO::NeighborPositionDTO(const NeighborPosition& pos) :
m_distance(pos.distance),
m_relativeOrientation(pos.relative_orientation),
m_inLOS(pos.in_los) {}
m_distance(pos.distance), m_azimuth(pos.azimuth), m_inLOS(pos.in_los) {}

NeighborPositionDTO::NeighborPositionDTO(float distance, float relativeOrientation, bool inLOS) :
m_distance(distance), m_relativeOrientation(relativeOrientation), m_inLOS(inLOS) {}
NeighborPositionDTO::NeighborPositionDTO(float distance, float azimuth, bool inLOS) :
m_distance(distance), m_azimuth(azimuth), m_inLOS(inLOS) {}

float NeighborPositionDTO::getDistance() const { return m_distance; }

bool NeighborPositionDTO::inLOS() const { return m_inLOS; }

float NeighborPositionDTO::getRelativeOrientation() const { return m_relativeOrientation; }
float NeighborPositionDTO::getAzimuth() const { return m_azimuth; }

void NeighborPositionDTO::setDistance(float distance) { m_distance = distance; }

void NeighborPositionDTO::setRelativeOrientation(float orientation) {
m_relativeOrientation = orientation;
}
void NeighborPositionDTO::setAzimuth(float azimuth) { m_azimuth = azimuth; }

void NeighborPositionDTO::setInLOS(bool inLOS) { m_inLOS = inLOS; }

bool NeighborPositionDTO::serialize(NeighborPosition& pos) const {
pos.distance = m_distance;
pos.relative_orientation = m_relativeOrientation;
pos.azimuth = m_azimuth;
pos.in_los = m_inLOS;
return true;
}
2 changes: 1 addition & 1 deletion src/pheromones/tests/NeighborPositionDTOUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ TEST_F(NeighborPositionDTOFixture, NeighborPosition_serialize_valid) {
// Expect
EXPECT_TRUE(ret);
EXPECT_EQ(pos.distance, m_pos->getDistance());
EXPECT_EQ(pos.relative_orientation, m_pos->getRelativeOrientation());
EXPECT_EQ(pos.azimuth, m_pos->getAzimuth());
EXPECT_EQ(pos.in_los, m_pos->inLOS());
}

0 comments on commit 3cbc543

Please sign in to comment.