Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jul 14, 2021
2 parents f0647db + 9dadb51 commit 44858b6
Show file tree
Hide file tree
Showing 133 changed files with 2,941 additions and 1,447 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ workflows:
build:
jobs:
- full-u20.04-focal-codecov
- full-u18.04-bionic
# Disabled to avoid circle CI concurrency limit timeouts
# - full-u18.04-bionic
- clang-u18.04-bionic
- headless-u18.04-bionic
- minimal-u18.04-bionic
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ the GitHub contributors page (https://github.com/MRPT/mrpt/graphs/contributors).
* Vicente Arevalo Espejo, University of Malaga.
- The application camera-calib.
- Some classes: mrpt::opengl::CSetOfTexturedTriangles, etc..
- Some minor changes in: 3DSceneViewer and RawlogViewer applications.
- Some minor changes in: SceneViewer3D and RawlogViewer applications.
- Some image-related functions.

* Adrien Barral - Robopec (France).
Expand Down
11 changes: 1 addition & 10 deletions apps/2d-slam-demo/slamdemoMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotGT->AddLayer(m_lyGTvisibleRange);

plotGT->LockAspect();
plotGT->EnableDoubleBuffer(true);

// Map plot ------------
m_lyMapRobot = new mpPolygon();
Expand All @@ -857,7 +856,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
m_lyMapRobot->SetCoordinateBase(0, 0, 0);
plotMap->AddLayer(m_lyMapRobot);
plotMap->LockAspect();
plotMap->EnableDoubleBuffer(true);

// Observations plot ------------
m_lyObsRobot = new mpPolygon();
Expand All @@ -874,7 +872,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotObs->AddLayer(m_lyObsvisibleRange);

plotObs->LockAspect();
plotObs->EnableDoubleBuffer(true);

// IC plot ------------
m_lyICvisibleRange = new mpPolygon();
Expand All @@ -884,7 +881,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotIndivCompat->AddLayer(m_lyICvisibleRange);

plotIndivCompat->LockAspect(false);
plotIndivCompat->EnableDoubleBuffer(true);

// X ERROR plot ------------
m_lyERRX_err = new mpFXYVector();
Expand All @@ -903,7 +899,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotErrorX->AddLayer(m_lyERRX_boundDown);

plotErrorX->LockAspect(false);
plotErrorX->EnableDoubleBuffer(true);

// Y ERROR plot ------------
m_lyERRY_err = new mpFXYVector();
Expand All @@ -922,7 +917,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotErrorY->AddLayer(m_lyERRY_boundDown);

plotErrorY->LockAspect(false);
plotErrorY->EnableDoubleBuffer(true);

// Phi ERROR plot ------------
m_lyERRPHI_err = new mpFXYVector();
Expand All @@ -941,7 +935,6 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotErrorPhi->AddLayer(m_lyERRPHI_boundDown);

plotErrorPhi->LockAspect(false);
plotErrorPhi->EnableDoubleBuffer(true);

// Stats Time plot ------------
m_lyStatTimes = new mpFXYVector();
Expand All @@ -950,16 +943,14 @@ slamdemoFrame::slamdemoFrame(wxWindow* parent, wxWindowID id)
plotStatTime->AddLayer(m_lyStatTimes);

plotStatTime->LockAspect(false);
plotStatTime->EnableDoubleBuffer(true);

// DA Stats plots ------------
#define INIT_DA_PLOT(CODE) \
m_lyDa##CODE = new mpFXYVector(); \
m_lyDa##CODE->SetPen(wxPen(wxColour(0, 0, 0), 5)); \
m_lyDa##CODE->SetContinuity(false); \
plotDa##CODE->AddLayer(m_lyDa##CODE); \
plotDa##CODE->LockAspect(false); \
plotDa##CODE->EnableDoubleBuffer(true);
plotDa##CODE->LockAspect(false);

INIT_DA_PLOT(FP);
INIT_DA_PLOT(FN);
Expand Down
84 changes: 54 additions & 30 deletions apps/RawLogViewer/CFormPlayVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ void CFormPlayVideo::OnbtnPlayClick(wxCommandEvent& event)
{
wxTheApp->Yield();
CSerializable::Ptr obj;
mrpt::Clock::time_point imgTimestamp = INVALID_TIMESTAMP;

if (fil) { archiveFrom(*fil) >> obj; }
else
Expand All @@ -523,25 +524,38 @@ void CFormPlayVideo::OnbtnPlayClick(wxCommandEvent& event)

bool doDelay = false;

if (IS_CLASS(*obj, CSensoryFrame))
{ doDelay = showSensoryFrame(obj.get(), nImgs); }
if (auto sf = std::dynamic_pointer_cast<CSensoryFrame>(obj); sf)
{ doDelay = showSensoryFrame(*sf, nImgs, imgTimestamp); }
else if (IS_DERIVED(*obj, CObservation))
{
CSensoryFrame sf;
sf.insert(std::dynamic_pointer_cast<CObservation>(obj));
doDelay = showSensoryFrame(&sf, nImgs);
CSensoryFrame sf2;
sf2.insert(std::dynamic_pointer_cast<CObservation>(obj));
doDelay = showSensoryFrame(sf2, nImgs, imgTimestamp);
}

// Free the loaded object!
if (fil) obj.reset();

// Update UI
if ((count++) % 100 == 0)
count++;
// if ((count) % 10 == 0)
{
progressBar->SetValue(
fil ? (int)fil->getPosition() : (int)count);
wxString str;
str.sprintf(_("Processed: %d images"), nImgs);
if (imgTimestamp != INVALID_TIMESTAMP)
{
str.sprintf(
_("Processed: %d images. Timestamp: %f [%s UTC]"),
static_cast<int>(nImgs),
mrpt::Clock::toDouble(imgTimestamp),
mrpt::system::dateTimeToString(imgTimestamp).c_str());
}
else
{
str.sprintf(
_("Processed: %d images."), static_cast<int>(nImgs));
}
lbProgress->SetLabel(str);
if (!doDelay) wxTheApp->Yield();
}
Expand Down Expand Up @@ -652,12 +666,12 @@ void CFormPlayVideo::drawHorzRules(mrpt::img::CImage& img)
img.line(0, y, w - 1, y, mrpt::img::TColor::white());
}

bool CFormPlayVideo::showSensoryFrame(void* SF, size_t& nImgs)
bool CFormPlayVideo::showSensoryFrame(
mrpt::obs::CSensoryFrame& SF, size_t& nImgs, Clock::time_point& timestamp)
{
WX_START_TRY

ASSERT_(SF);
auto* sf = (CSensoryFrame*)SF;
auto* sf = &SF;

bool doDelay = false;
bool doReduceLargeImgs = cbReduceLarge->GetValue();
Expand Down Expand Up @@ -685,6 +699,8 @@ bool CFormPlayVideo::showSensoryFrame(void* SF, size_t& nImgs)
sf->getObservationByClass<CObservationImage>(img_idx_sf);
if (!obsImg) break; // No more images, go on...

timestamp = obsImg->timestamp;

// Onto which panel to draw??
if (!orderByYaw && !orderByY)
{
Expand Down Expand Up @@ -810,8 +826,10 @@ bool CFormPlayVideo::showSensoryFrame(void* SF, size_t& nImgs)
{
CObservationStereoImages::Ptr obsImg2 =
sf->getObservationByClass<CObservationStereoImages>();

if (obsImg2)
{
timestamp = obsImg2->timestamp;
nImgs++;

// Left:
Expand Down Expand Up @@ -944,8 +962,10 @@ bool CFormPlayVideo::showSensoryFrame(void* SF, size_t& nImgs)
{
CObservation3DRangeScan::Ptr obs3D =
sf->getObservationByClass<CObservation3DRangeScan>();

if (obs3D && obs3D->hasIntensityImage)
{
timestamp = obs3D->timestamp;
nImgs++;

// Intensity channel
Expand Down Expand Up @@ -997,32 +1017,45 @@ bool CFormPlayVideo::showSensoryFrame(void* SF, size_t& nImgs)
return false;
}

void CFormPlayVideo::OnprogressBarCmdScrollChanged(wxScrollEvent& event)
void CFormPlayVideo::OnprogressBarCmdScrollChanged(wxScrollEvent&)
{
int idx = progressBar->GetValue();
m_idxInRawlog = idx;
mrpt::Clock::time_point imgTimestamp;
size_t nImgs = 0;

if (idx > 0 && idx < (int)rawlog.size())
{
if (rawlog.getType(idx) == CRawlog::etSensoryFrame)
{
size_t dummy = 0;

CSensoryFrame::Ptr sf = rawlog.getAsObservations(idx);
showSensoryFrame(sf.get(), dummy);
showSensoryFrame(*sf.get(), nImgs, imgTimestamp);
edIndex->SetValue(idx);
}
else if (rawlog.getType(idx) == CRawlog::etObservation)
{
size_t dummy = 0;

CObservation::Ptr o = rawlog.getAsObservation(idx);

CSensoryFrame sf;
sf.insert(o);
showSensoryFrame(&sf, dummy);
showSensoryFrame(sf, nImgs, imgTimestamp);

edIndex->SetValue(idx);
}

wxString str;
if (imgTimestamp != INVALID_TIMESTAMP)
{
str.sprintf(
_("Processed: %d images. Timestamp: %f [%s UTC]"),
static_cast<int>(nImgs), mrpt::Clock::toDouble(imgTimestamp),
mrpt::system::dateTimeToString(imgTimestamp).c_str());
}
else
{
str.sprintf(_("Processed: %d images."), static_cast<int>(nImgs));
}
lbProgress->SetLabel(str);
}
}

Expand Down Expand Up @@ -1103,20 +1136,11 @@ void CFormPlayVideo::saveCamImage(int n)
WX_END_TRY
}

void CFormPlayVideo::OnbtnSaveCam1Click(wxCommandEvent& event)
{
saveCamImage(0);
}
void CFormPlayVideo::OnbtnSaveCam2Click(wxCommandEvent& event)
{
saveCamImage(1);
}
void CFormPlayVideo::OnbtnSaveCam3Click(wxCommandEvent& event)
{
saveCamImage(2);
}
void CFormPlayVideo::OnbtnSaveCam1Click(wxCommandEvent&) { saveCamImage(0); }
void CFormPlayVideo::OnbtnSaveCam2Click(wxCommandEvent&) { saveCamImage(1); }
void CFormPlayVideo::OnbtnSaveCam3Click(wxCommandEvent&) { saveCamImage(2); }

void CFormPlayVideo::OncbImageDirsSelect(wxCommandEvent& event)
void CFormPlayVideo::OncbImageDirsSelect(wxCommandEvent&)
{
wxString dir = cbImageDirs->GetValue();
string dirc = string(dir.mb_str());
Expand Down
6 changes: 5 additions & 1 deletion apps/RawLogViewer/CFormPlayVideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
#include <wx/textctrl.h>
//*)

#include <mrpt/core/Clock.h>
#include <mrpt/img/CImage.h>
#include <mrpt/obs/obs_frwds.h>

class CFormPlayVideo : public wxDialog
{
Expand Down Expand Up @@ -87,7 +89,9 @@ class CFormPlayVideo : public wxDialog
void OncbImageDirsSelect(wxCommandEvent& event);
//*)

bool showSensoryFrame(void* SF, size_t& nImgs);
bool showSensoryFrame(
mrpt::obs::CSensoryFrame& SF, size_t& nImgs,
mrpt::Clock::time_point& timestamp);

void drawHorzRules(mrpt::img::CImage& img);

Expand Down
3 changes: 0 additions & 3 deletions apps/RawLogViewer/CFormRawMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ void CFormRawMap::OnbtnGenerateClick(wxCommandEvent&)

plotMap->AddLayer(lyPoints);
plotMap->AddLayer(lyPath);
plotMap->EnableDoubleBuffer(true);

lyPath->SetData(pathX, pathY);

Expand Down Expand Up @@ -976,7 +975,6 @@ void CFormRawMap::OnbtnGeneratePathsClick(wxCommandEvent&)
plotMap->AddLayer(lyCov, false);

//
plotMap->EnableDoubleBuffer(true);

plotMap->Fit(); // Update the window to show the new data fitted.
plotMap->LockAspect(true);
Expand Down Expand Up @@ -1121,7 +1119,6 @@ void CFormRawMap::OnGenerateFromRTK(wxCommandEvent&)

plotMap->AddLayer(lyPoints);
plotMap->AddLayer(lyPath);
plotMap->EnableDoubleBuffer(true);

lyPath->SetData(pathX, pathY);

Expand Down
10 changes: 10 additions & 0 deletions apps/RawLogViewer/CRawlogTreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ std::atomic_bool CRawlogTreeView::RAWLOG_UNDERGOING_CHANGES{false};
#define MRPT_NO_WARN_BIG_HDR // It's ok here
#include <mrpt/gui/WxUtils.h>
#include <mrpt/obs.h>
#include <mrpt/obs/CObservationPointCloud.h> // this one is in mrpt-maps

using namespace mrpt;
using namespace mrpt::system;
Expand Down Expand Up @@ -413,6 +414,15 @@ int CRawlogTreeView::iconIndexFromClass(const TRuntimeClassId* class_ID)
iconIndex = 8;
else if (class_ID == CLASS_ID(CObservationRFID))
iconIndex = 8;
else if (class_ID == CLASS_ID(CObservationOdometry))
iconIndex = 9;
else if (
class_ID == CLASS_ID(CObservation3DRangeScan) ||
class_ID == CLASS_ID(CObservationVelodyneScan) ||
class_ID == CLASS_ID(CObservationPointCloud))
iconIndex = 10;
else if (class_ID == CLASS_ID(CObservationIMU))
iconIndex = 11;
else if (class_ID->derivedFrom(CLASS_ID(CObservation)))
iconIndex = 2; // Default observation
else if (class_ID == CLASS_ID(CActionCollection))
Expand Down
2 changes: 1 addition & 1 deletion apps/RawLogViewer/CScanAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ void CScanAnimation::OnbtnVizOptions(wxCommandEvent&)
wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
dlgViz = &dlg;

auto sizer1 = new wxFlexGridSizer(2, 1, 0, 0);
auto sizer1 = new wxFlexGridSizer(0, 1, 0, 0);
sizer1->AddGrowableCol(0);

auto panel = new ViewOptions3DPoints(&dlg);
Expand Down
Loading

0 comments on commit 44858b6

Please sign in to comment.