Skip to content

Commit

Permalink
Fix compilation on armhf.
Browse files Browse the repository at this point in the history
  • Loading branch information
eupedrosa committed Sep 2, 2022
1 parent 0f37ac5 commit 59564c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ target_include_directories(iris_lama
target_compile_features(iris_lama PUBLIC cxx_std_14)
target_compile_options(iris_lama PRIVATE -Wall -Wextra)

if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
target_compile_options(iris_lama PRIVATE -faligned-new)
endif()

target_link_libraries(iris_lama PUBLIC pthread Eigen3::Eigen)
target_include_directories(iris_lama PRIVATE extern/minisam)

2 changes: 1 addition & 1 deletion src/loc2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void lama::Loc2D::addSamplingCovariance(const PointCloudXYZ::Ptr& surface)
Affine3d moving_tf = Translation3d(surface->sensor_origin_) * surface->sensor_orientation_;

const size_t num_points = surface->points.size();
const size_t step = std::max(num_points / 100, 1ul);
const size_t step = std::max(num_points / 100, size_t(1));

auto aa = AngleAxisd(pose_.rotation(), Vector3d::UnitZ());
for (size_t i = 0; i < sampling_steps_.size(); ++i){
Expand Down
16 changes: 8 additions & 8 deletions src/sdm/simple_occupancy_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "lama/sdm/simple_occupancy_map.h"

lama::SimpleOccupancyMap::SimpleOccupancyMap(double resolution, uint32_t patch_size, bool is3d)
: OccupancyMap(resolution, sizeof(char), patch_size, is3d)
: OccupancyMap(resolution, sizeof(int8_t), patch_size, is3d)
{}

lama::SimpleOccupancyMap::SimpleOccupancyMap(const SimpleOccupancyMap& other)
Expand All @@ -51,7 +51,7 @@ bool lama::SimpleOccupancyMap::setFree(const Vector3d& coordinates)

bool lama::SimpleOccupancyMap::setFree(const Vector3ui& coordinates)
{
char* cell = (char*) get(coordinates);
int8_t* cell = (int8_t*) get(coordinates);
if (*cell == -1)
return false;

Expand All @@ -66,7 +66,7 @@ bool lama::SimpleOccupancyMap::setOccupied(const Vector3d& coordinates)

bool lama::SimpleOccupancyMap::setOccupied(const Vector3ui& coordinates)
{
char* cell = (char*) get(coordinates);
int8_t* cell = (int8_t*) get(coordinates);
if (*cell == 1)
return false;

Expand All @@ -81,7 +81,7 @@ bool lama::SimpleOccupancyMap::setUnknown(const Vector3d& coordinates)

bool lama::SimpleOccupancyMap::setUnknown(const Vector3ui& coordinates)
{
char* cell = (char*) get(coordinates);
int8_t* cell = (int8_t*) get(coordinates);
if ( *cell == 0 )
return false;

Expand All @@ -96,7 +96,7 @@ bool lama::SimpleOccupancyMap::isFree(const Vector3d& coordinates) const

bool lama::SimpleOccupancyMap::isFree(const Vector3ui& coordinates) const
{
const char* cell = (const char*) get(coordinates);
const int8_t* cell = (const int8_t*) get(coordinates);
if (cell == 0)
return false;

Expand All @@ -110,7 +110,7 @@ bool lama::SimpleOccupancyMap::isOccupied(const Vector3d& coordinates) const

bool lama::SimpleOccupancyMap::isOccupied(const Vector3ui& coordinates) const
{
const char* cell = (const char*) get(coordinates);
const int8_t* cell = (const int8_t*) get(coordinates);
if (cell == 0)
return false;

Expand All @@ -124,7 +124,7 @@ bool lama::SimpleOccupancyMap::isUnknown(const Vector3d& coordinates) const

bool lama::SimpleOccupancyMap::isUnknown(const Vector3ui& coordinates) const
{
const char* cell = (const char*) get(coordinates);
const int8_t* cell = (const int8_t*) get(coordinates);
if (cell == 0) return true;

return *cell == 0;
Expand All @@ -137,7 +137,7 @@ double lama::SimpleOccupancyMap::getProbability(const Vector3d& coordinates) con

double lama::SimpleOccupancyMap::getProbability(const Vector3ui& coordinates) const
{
const char* cell = (const char*) get(coordinates);
const int8_t* cell = (const int8_t*) get(coordinates);
if (cell == 0) return 0.5;

switch(*cell){
Expand Down

0 comments on commit 59564c9

Please sign in to comment.