Skip to content

Commit

Permalink
Merge branch 'master' into circle-ci-clang-format-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jolting committed Oct 19, 2018
2 parents 52233ef + adbfed3 commit 8bff2b0
Show file tree
Hide file tree
Showing 1,163 changed files with 27,253 additions and 27,801 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Expand Up @@ -11,6 +11,22 @@ jobs:
- run: make gcov -C build
- run: make -C build
- run: bash <(curl -s https://codecov.io/bash) -X gcov -y .codecov.yml -s build
clang:
docker:
- image: mrpt/mrpt-build-env:full-bionic
steps:
- checkout
- run:
name: Generate cmake files
command: cmake -DBUILD_EXAMPLES=On -DBUILD_TESTING=On -DENABLE_COVERAGE=On -H. -Bbuild
environment:
CC: /usr/bin/clang-6.0
CXX: /usr/bin/clang++-6.0
- run: make -C build tests_build_all
- run: make CTEST_OUTPUT_ON_FAILURE=1 test -C build
- run: make gcov -C build
- run: make -C build
- run: bash <(curl -s https://codecov.io/bash) -X gcov -y .codecov.yml -s build
headless:
docker:
- image: mrpt/mrpt-build-env:headless-bionic
Expand Down Expand Up @@ -48,4 +64,5 @@ workflows:
- full
- headless
- minimal
- clang
- clang-format-lint
10 changes: 6 additions & 4 deletions apps/2d-slam-demo/CDlgParams.cpp
Expand Up @@ -402,8 +402,9 @@ CDlgParams::CDlgParams(
FlexGridSizer12->AddGrowableCol(0);
FlexGridSizer13 = new wxFlexGridSizer(0, 3, 0, 0);
cbSensorDistin = new wxCheckBox(
this, ID_CHECKBOX1, _("Sensor distingishes landmarks (Checked: avoids "
"data association problem)"),
this, ID_CHECKBOX1,
_("Sensor distingishes landmarks (Checked: avoids "
"data association problem)"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
_T("ID_CHECKBOX1"));
cbSensorDistin->SetValue(false);
Expand Down Expand Up @@ -518,8 +519,9 @@ CDlgParams::CDlgParams(
FlexGridSizer20 = new wxFlexGridSizer(1, 2, 0, 0);
FlexGridSizer20->AddGrowableCol(1);
StaticText26 = new wxStaticText(
this, ID_STATICTEXT26, _("Normally-distributeed number\nof spurious "
"per \"observation\":\n(Both to 0 = disable)"),
this, ID_STATICTEXT26,
_("Normally-distributeed number\nof spurious "
"per \"observation\":\n(Both to 0 = disable)"),
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE,
_T("ID_STATICTEXT26"));
FlexGridSizer20->Add(
Expand Down
7 changes: 3 additions & 4 deletions apps/2d-slam-demo/batch_experiments.cpp
Expand Up @@ -80,10 +80,9 @@ void slamdemoApp::DoBatchExperiments(const std::string& cfgFil)
{
}
err_D2 += dm2;
err_phi += fabs(
wrapToPi(
win->m_historicData[i].GT_robot_pose.phi() -
win->m_historicData[i].estimate_robot_pose.getMeanVal().phi()));
err_phi += fabs(wrapToPi(
win->m_historicData[i].GT_robot_pose.phi() -
win->m_historicData[i].estimate_robot_pose.getMeanVal().phi()));
}

if (N)
Expand Down
3 changes: 1 addition & 2 deletions apps/DifOdometry-Camera/DifOdometry_Camera.cpp
Expand Up @@ -169,8 +169,7 @@ void CDifodoCamera::loadFrame()
const int width = framed.getWidth();

// Store the depth values
const openni::DepthPixel* pDepthRow =
(const openni::DepthPixel*)framed.getData();
const auto* pDepthRow = (const openni::DepthPixel*)framed.getData();
int rowSize = framed.getStrideInBytes() / sizeof(openni::DepthPixel);

for (int yc = height - 1; yc >= 0; --yc)
Expand Down
10 changes: 5 additions & 5 deletions apps/DifOdometry-Camera/DifOdometry_Camera.h
Expand Up @@ -55,14 +55,14 @@ class CDifodoCamera : public mrpt::vision::CDifodo

/** A pre-step that should be performed before starting to estimate the
* camera velocity.
* It can also be called to reset the estimated trajectory and pose */
* It can also be called to reset the estimated trajectory and pose */
void reset();

/** Save the pose estimation following the format of the TUM datasets:
*
* 'timestamp tx ty tz qx qy qz qw'
*
* Please visit
*
* 'timestamp tx ty tz qx qy qz qw'
*
* Please visit
* http://vision.in.tum.de/data/datasets/rgbd-dataset/file_formats for
* further details.*/
void writeTrajectoryFile();
Expand Down
12 changes: 6 additions & 6 deletions apps/DifOdometry-Datasets/DifOdometry_Datasets.h
Expand Up @@ -63,16 +63,16 @@ class CDifodoDatasets : public mrpt::vision::CDifodo

/** A pre-step that should be performed before starting to estimate the
* camera speed
* As a couple of frames are necessary to estimate the camera motion, this
* As a couple of frames are necessary to estimate the camera motion, this
* methods loads the first frame
* before any motion can be estimated.*/
* before any motion can be estimated.*/
void reset();

/** Save the pose estimation following the format of the TUM datasets:
*
* 'timestamp tx ty tz qx qy qz qw'
*
* Please visit
*
* 'timestamp tx ty tz qx qy qz qw'
*
* Please visit
* http://vision.in.tum.de/data/datasets/rgbd-dataset/file_formats for
* further details.*/
void writeTrajectoryFile();
Expand Down
2 changes: 1 addition & 1 deletion apps/GridmapNavSimul/gridmapSimulApp.cpp
Expand Up @@ -36,7 +36,7 @@ bool gridmapSimulApp::OnInit()
wxInitAllImageHandlers();
if (wxsOK)
{
gridmapSimulFrame* Frame = new gridmapSimulFrame(nullptr);
auto* Frame = new gridmapSimulFrame(nullptr);
Frame->Show();
SetTopWindow(Frame);
}
Expand Down
7 changes: 4 additions & 3 deletions apps/RawLogViewer/CFormBatchSensorPose.cpp
Expand Up @@ -155,9 +155,10 @@ void CFormBatchSensorPose::OnbtnOpenClick(wxCommandEvent& event)
wxFileDialog dialog(
this, _("Select file with sensor parameters") /* caption */,
_U(iniFile->read_string(iniFileSect, "LastDir", ".").c_str()),
_("*.ini") /* defaultFilename */, _("rawlog-grabber config files "
"(*.ini)|*.ini|All files "
"(*.*)|*.*") /* wildcard */,
_("*.ini") /* defaultFilename */,
_("rawlog-grabber config files "
"(*.ini)|*.ini|All files "
"(*.*)|*.*") /* wildcard */,
wxFD_OPEN | wxFD_FILE_MUST_EXIST);

if (dialog.ShowModal() != wxID_OK) return;
Expand Down
21 changes: 10 additions & 11 deletions apps/RawLogViewer/CFormChangeSensorPositions.cpp
Expand Up @@ -866,8 +866,8 @@ void CFormChangeSensorPositions::executeOperationOnRawlog(

if (!isInMemory) archiveFrom(*out_fil) << *acts;
}
else if (
newObj->GetRuntimeClass()->derivedFrom(CLASS_ID(CObservation)))
else if (newObj->GetRuntimeClass()->derivedFrom(
CLASS_ID(CObservation)))
{
// A sensory frame:
CObservation::Ptr o(
Expand All @@ -884,10 +884,9 @@ void CFormChangeSensorPositions::executeOperationOnRawlog(
}
else
{ // Unknown class:
THROW_EXCEPTION(
format(
"Unexpected class found in the file: '%s'",
newObj->GetRuntimeClass()->className));
THROW_EXCEPTION(format(
"Unexpected class found in the file: '%s'",
newObj->GetRuntimeClass()->className));
}
}
catch (exception& e)
Expand Down Expand Up @@ -971,7 +970,7 @@ void exec_setPoseByLabel(
{
for (auto obs : *SF)
{
if (obs->sensorLabel == labelToProcess)
if (obs->sensorLabel == labelToProcess)
{
if (changeOnlyXYZ)
{
Expand Down Expand Up @@ -1106,7 +1105,7 @@ void exec_getCurrentCamCfgByIdx(
if (SF->getObservationByIndex(idxToProcess)->GetRuntimeClass() ==
CLASS_ID(CObservationImage))
{
CObservationImage::Ptr obsIm =
auto obsIm =
SF->getObservationByIndexAs<CObservationImage::Ptr>(
idxToProcess);
camDistortion =
Expand All @@ -1127,7 +1126,7 @@ void exec_getCurrentCamCfgByLabel(

if (o && o->GetRuntimeClass() == CLASS_ID(CObservationImage))
{
CObservationImage::Ptr obsIm =
auto obsIm =
SF->getObservationBySensorLabelAs<CObservationImage::Ptr>(
labelToProcess);
camDistortion = obsIm->cameraParams.getDistortionParamsAsVector();
Expand Down Expand Up @@ -1191,7 +1190,7 @@ void exec_setCurrentCamCfgByIdx(
if (SF->getObservationByIndex(idxToProcess)->GetRuntimeClass() ==
CLASS_ID(CObservationImage))
{
CObservationImage::Ptr obsIm =
auto obsIm =
SF->getObservationByIndexAs<CObservationImage::Ptr>(
idxToProcess);
obsIm->cameraParams.setDistortionParamsVector(camDistortion);
Expand All @@ -1210,7 +1209,7 @@ void exec_setCurrentCamCfgByLabel(
CObservation::Ptr o = SF->getObservationBySensorLabel(labelToProcess);
if (o && o->GetRuntimeClass() == CLASS_ID(CObservationImage))
{
CObservationImage::Ptr obsIm =
auto obsIm =
SF->getObservationBySensorLabelAs<CObservationImage::Ptr>(
labelToProcess);
obsIm->cameraParams.setDistortionParamsVector(camDistortion);
Expand Down
44 changes: 20 additions & 24 deletions apps/RawLogViewer/CFormEdit.cpp
Expand Up @@ -361,8 +361,8 @@ CFormEdit::CFormEdit(wxWindow* parent, wxWindowID id)
FlexGridSizer5->AddGrowableCol(0);
FlexGridSizer5->AddGrowableRow(0);
cbObsClass = new wxCheckListBox(
this, ID_CHECKLISTBOX2, wxDefaultPosition, wxSize(-1, 200), 0, nullptr, 0,
wxDefaultValidator, _T("ID_CHECKLISTBOX2"));
this, ID_CHECKLISTBOX2, wxDefaultPosition, wxSize(-1, 200), 0, nullptr,
0, wxDefaultValidator, _T("ID_CHECKLISTBOX2"));
cbObsClass->SetMaxSize(wxSize(-1, 200));
FlexGridSizer5->Add(
cbObsClass, 1, wxALL | wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP, 5);
Expand Down Expand Up @@ -397,8 +397,8 @@ CFormEdit::CFormEdit(wxWindow* parent, wxWindowID id)
FlexGridSizer13->AddGrowableCol(0);
FlexGridSizer13->AddGrowableRow(0);
cbObsLabel = new wxCheckListBox(
this, ID_CHECKLISTBOX1, wxDefaultPosition, wxSize(-1, 200), 0, nullptr, 0,
wxDefaultValidator, _T("ID_CHECKLISTBOX1"));
this, ID_CHECKLISTBOX1, wxDefaultPosition, wxSize(-1, 200), 0, nullptr,
0, wxDefaultValidator, _T("ID_CHECKLISTBOX1"));
cbObsLabel->SetMaxSize(wxSize(-1, 200));
FlexGridSizer13->Add(
cbObsLabel, 1, wxALL | wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP, 5);
Expand Down Expand Up @@ -624,7 +624,7 @@ void filter_delObsByIndex(
if (SF)
{
int j = 0;
for (CSensoryFrame::iterator it = SF->begin(); it != SF->end(); ++j)
for (auto it = SF->begin(); it != SF->end(); ++j)
{
if (auxMask[j])
{
Expand Down Expand Up @@ -664,7 +664,7 @@ void filter_delObsByClass(
{
if (SF)
{
for (CSensoryFrame::iterator it = SF->begin(); it != SF->end();)
for (auto it = SF->begin(); it != SF->end();)
{
CObservation::Ptr obs = *it;
if (string::npos != find_in_vector(
Expand All @@ -687,7 +687,7 @@ void filter_remObsByClass(
{
if (SF)
{
for (CSensoryFrame::iterator it = SF->begin(); it != SF->end();)
for (auto it = SF->begin(); it != SF->end();)
{
CObservation::Ptr obs = *it;
if (string::npos == find_in_vector(
Expand Down Expand Up @@ -726,8 +726,7 @@ void filter_delActsByIndex(
if (acts)
{
int j = 0;
for (CActionCollection::iterator it = acts->begin(); it != acts->end();
++j)
for (auto it = acts->begin(); it != acts->end(); ++j)
{
if (auxMask[j])
{
Expand Down Expand Up @@ -783,9 +782,9 @@ void filter_swapColors(
{
for (auto obs : *SF)
{
if (IS_CLASS(obs, CObservationImage))
if (IS_CLASS(obs, CObservationImage))
{
CObservationImage* o = (CObservationImage*)obs.get();
auto* o = (CObservationImage*)obs.get();
if (o->image.isColor())
{
swapColors(o->image);
Expand All @@ -794,8 +793,7 @@ void filter_swapColors(
}
else if (IS_CLASS(obs, CObservationStereoImages))
{
CObservationStereoImages* o =
(CObservationStereoImages*)obs.get();
auto* o = (CObservationStereoImages*)obs.get();
if (o->imageLeft.isColor())
{
swapColors(o->imageLeft);
Expand Down Expand Up @@ -1052,8 +1050,8 @@ void CFormEdit::executeOperationOnRawlog(

if (!isInMemory) archiveFrom(*out_fil) << *sf;
}
else if (
newObj->GetRuntimeClass()->derivedFrom(CLASS_ID(CObservation)))
else if (newObj->GetRuntimeClass()->derivedFrom(
CLASS_ID(CObservation)))
{
// A single observation:
dummy_sf->clear();
Expand Down Expand Up @@ -1092,10 +1090,9 @@ void CFormEdit::executeOperationOnRawlog(
}
else
{ // Unknown class:
THROW_EXCEPTION(
format(
"Unexpected class found in the file: '%s'",
newObj->GetRuntimeClass()->className));
THROW_EXCEPTION(format(
"Unexpected class found in the file: '%s'",
newObj->GetRuntimeClass()->className));
}
}
catch (exception& e)
Expand Down Expand Up @@ -1149,7 +1146,7 @@ void filter_delObsByLabel(
{
if (SF)
{
for (CSensoryFrame::iterator it = SF->begin(); it != SF->end();)
for (auto it = SF->begin(); it != SF->end();)
{
CObservation::Ptr obs = *it;
if (string::npos !=
Expand All @@ -1171,7 +1168,7 @@ void filter_NotDelObsByLabel(
{
if (SF)
{
for (CSensoryFrame::iterator it = SF->begin(); it != SF->end();)
for (auto it = SF->begin(); it != SF->end();)
{
CObservation::Ptr obs = *it;
if (string::npos ==
Expand Down Expand Up @@ -1225,14 +1222,13 @@ void leave_horizontalScans(
{
if (SF)
{
for (CSensoryFrame::iterator it = SF->begin(); it != SF->end();)
for (auto it = SF->begin(); it != SF->end();)
{
CObservation::Ptr obs = *it;

if (IS_CLASS(obs, CObservation2DRangeScan))
{
CObservation2DRangeScan* o =
static_cast<CObservation2DRangeScan*>(obs.get());
auto* o = static_cast<CObservation2DRangeScan*>(obs.get());

if (fabs(o->sensorPose.pitch()) > minPitchToDeleteLaserScan)
{
Expand Down
2 changes: 1 addition & 1 deletion apps/RawLogViewer/CFormMotionModel.cpp
Expand Up @@ -821,7 +821,7 @@ void CFormMotionModel::applyToRawlogFile()
CFileGZInputStream in_fil(fileName_IN);
CFileGZOutputStream out_fil(fileName_OUT);

unsigned int filSize = (unsigned int)in_fil.getTotalBytesCount();
auto filSize = (unsigned int)in_fil.getTotalBytesCount();

wxProgressDialog progDia(
wxT("Modifying motion model"), wxT("Processing file..."),
Expand Down

0 comments on commit 8bff2b0

Please sign in to comment.