Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
PathTracer2D.hpp
1
12#ifndef PATH_TRACER_2D_HPP
13#define PATH_TRACER_2D_HPP
14
15#include "../GeospatialOperations.hpp"
16
18#include <chrono>
19#include <matplot/matplot.h>
20
22
23
31namespace logging
32{
33
42 namespace graphing
43 {
44
53 {
54 public:
55
62 PathTracer(const std::string& szPlotTitle = "Graph")
63 {
64 // Initialize member variables.
65 m_mtRoverPathPlot = matplot::figure(true);
66 m_mtRoverPathAxes = m_mtRoverPathPlot->current_axes();
67 m_szPlotTitle = szPlotTitle;
68
69 // Check if a file with the same title name already exists. If so then append a number to the end of the file name and recheck.
70 std::string szPlotSavePath = logging::g_szLoggingOutputPath + "/path_plots/" + m_szPlotTitle;
71 m_szCurrentPlotSavePath = logging::g_szLoggingOutputPath + "/path_plots/CurrentPlot.png";
72 int nFileNum = 0;
73 while (std::filesystem::exists(szPlotSavePath + std::to_string(nFileNum) + ".png"))
74 {
75 ++nFileNum;
76 }
77 // Add the file number to the file name.
78 szPlotSavePath = szPlotSavePath + std::to_string(nFileNum);
79 // Check if the final directory exists. If not then create it.
80 if (!std::filesystem::exists(logging::g_szLoggingOutputPath + "/path_plots"))
81 {
82 std::filesystem::create_directory(logging::g_szLoggingOutputPath + "/path_plots");
83 }
84
85 // Configure the matplotplusplus gnuplot backend to not display the plot, instead save it to a file.
86 m_mtRoverPathPlot->backend()->output(szPlotSavePath + ".png");
87
88 // Make sure plot title is not empty.
89 if (m_szPlotTitle.empty())
90 {
91 // Submit logger message.
92 LOG_WARNING(logging::g_qSharedLogger, "Plot title is empty. Setting title to default.");
93 m_szPlotTitle = "RoverPath";
94 }
95
96 // Configure plot.
97 m_mtRoverPathPlot->title(m_szPlotTitle);
98 m_mtRoverPathAxes->xlabel("Easting");
99 m_mtRoverPathAxes->ylabel("Northing");
100 }
101
102
110 {
111 // Nothing to do yet.
112 }
113
114
166 bool CreatePathLayer(const std::string& szLayerName, const std::string& szStyleString = "-o")
167 {
168 // Check if the layer name exists in the map.
169 if (m_umPathMap.find(szLayerName) != m_umPathMap.end())
170 {
171 // Submit logger message.
172 LOG_WARNING(logging::g_qSharedLogger, "Layer already exists. Cannot create layer.");
173 return false;
174 }
175
176 // Add the layer to the maps.
177 m_umPathMap[szLayerName] = std::vector<std::pair<double, double>>();
178 m_umPathLineStyleMap[szLayerName] = szStyleString;
179 m_umLastPlotUpdateTimeMap[szLayerName] = std::chrono::system_clock::now();
180
181 return true;
182 }
183
184
205 bool CreateDotLayer(const std::string& szLayerName, const std::string& szColorString = "blue", const bool bFillMarkerFace = true)
206 {
207 // Check if the layer name exists in the map.
208 if (m_umDotMap.find(szLayerName) != m_umDotMap.end())
209 {
210 // Submit logger message.
211 LOG_WARNING(logging::g_qSharedLogger, "Layer already exists. Cannot create layer.");
212 return false;
213 }
214
215 // Add the layer to the maps.
216 m_umDotMap[szLayerName] = std::vector<std::tuple<double, double, double>>();
217 m_umDotLineStyleMap[szLayerName] = std::make_pair(szColorString, bFillMarkerFace);
218 m_umLastDotUpdateTimeMap[szLayerName] = std::chrono::system_clock::now();
219
220 return true;
221 }
222
223
233 bool DeleteLayer(const std::string& szLayerName)
234 {
235 // Check if the layer name exist in the path or dot maps.
236 if (m_umPathMap.find(szLayerName) == m_umPathMap.end() && m_umDotMap.find(szLayerName) == m_umDotMap.end())
237 {
238 // Submit logger message.
239 LOG_WARNING(logging::g_qSharedLogger, "Layer does not exist. Cannot delete layer.");
240 return false;
241 }
242
243 // Remove the appropriate layers from the maps.
244 if (m_umPathMap.find(szLayerName) != m_umPathMap.end())
245 {
246 m_umPathMap.erase(szLayerName);
247 m_umPathLineStyleMap.erase(szLayerName);
248 m_umLastPlotUpdateTimeMap.erase(szLayerName);
249 }
250 if (m_umDotMap.find(szLayerName) != m_umDotMap.end())
251 {
252 m_umDotMap.erase(szLayerName);
253 m_umDotLineStyleMap.erase(szLayerName);
254 m_umLastDotUpdateTimeMap.erase(szLayerName);
255 }
256
257 return true;
258 }
259
260
270 bool ClearLayer(const std::string& szLayerName)
271 {
272 // Check if the layer name exist in the path or dot maps.
273 if (m_umPathMap.find(szLayerName) == m_umPathMap.end() && m_umDotMap.find(szLayerName) == m_umDotMap.end())
274 {
275 // Submit logger message.
276 LOG_WARNING(logging::g_qSharedLogger, "Layer does not exist. Cannot clear layer.");
277 return false;
278 }
279
280 // Clear the appropriate layer.
281 if (m_umPathMap.find(szLayerName) != m_umPathMap.end())
282 {
283 m_umPathMap[szLayerName].clear();
284 }
285 if (m_umDotMap.find(szLayerName) != m_umDotMap.end())
286 {
287 m_umDotMap[szLayerName].clear();
288 }
289
290 return true;
291 }
292
293
305 void AddPathPoint(const geoops::Waypoint& stWaypoint, const std::string& szLayerName, const uint nMaxWaypointsPerSecond = 1)
306 {
307 // Check the update time.
308 if (!this->CheckPathUpdateTime(szLayerName, nMaxWaypointsPerSecond))
309 {
310 // Return if the maximum number of waypoints per second has been exceeded.
311 return;
312 }
313
314 // Add the waypoint to the path.
315 m_umPathMap[szLayerName].emplace_back(stWaypoint.GetUTMCoordinate().dEasting, stWaypoint.GetUTMCoordinate().dNorthing);
316
317 // Update the plot.
318 this->UpdatePlot();
319 }
320
321
333 void AddPathPoint(const geoops::UTMCoordinate& stCoordinate, const std::string& szLayerName, const uint nMaxWaypointsPerSecond = 1)
334 {
335 // Check the update time.
336 if (!this->CheckPathUpdateTime(szLayerName, nMaxWaypointsPerSecond))
337 {
338 // Return if the maximum number of waypoints per second has been exceeded.
339 return;
340 }
341
342 // Add the waypoint to the path.
343 m_umPathMap[szLayerName].emplace_back(stCoordinate.dEasting, stCoordinate.dNorthing);
344
345 // Update the plot.
346 this->UpdatePlot();
347 }
348
349
361 void AddPathPoint(const geoops::GPSCoordinate& stCoordinate, const std::string& szLayerName, const uint nMaxWaypointsPerSecond = 1)
362 {
363 // Check the update time.
364 if (!this->CheckPathUpdateTime(szLayerName, nMaxWaypointsPerSecond))
365 {
366 // Return if the maximum number of waypoints per second has been exceeded.
367 return;
368 }
369
370 // Create instance variables.
371 geoops::UTMCoordinate stUTMCoordinate = geoops::ConvertGPSToUTM(stCoordinate);
372
373 // Add the waypoint to the path.
374 m_umPathMap[szLayerName].emplace_back(stUTMCoordinate.dEasting, stUTMCoordinate.dNorthing);
375
376 // Update the plot.
377 this->UpdatePlot();
378 }
379
380
393 void AddPathPoints(const std::vector<geoops::Waypoint>& stWaypoints, const std::string& szLayerName, const uint unMaxUpdatesPerSecond = 1)
394 {
395 // Check the update time.
396 if (!this->CheckPathUpdateTime(szLayerName, unMaxUpdatesPerSecond))
397 {
398 // Return if the maximum number of waypoints per second has been exceeded.
399 return;
400 }
401
402 // Add the waypoints to the vector or double pairs at the given layer name in the map.
403 for (const geoops::Waypoint& stWaypoint : stWaypoints)
404 {
405 m_umPathMap[szLayerName].emplace_back(stWaypoint.GetUTMCoordinate().dEasting, stWaypoint.GetUTMCoordinate().dNorthing);
406 }
407
408 // Update the plot.
409 this->UpdatePlot();
410 }
411
412
425 void AddPathPoints(const std::vector<geoops::UTMCoordinate>& vCoordinates, const std::string& szLayerName, const uint unMaxUpdatesPerSecond = 1)
426 {
427 // Check the update time.
428 if (!this->CheckPathUpdateTime(szLayerName, unMaxUpdatesPerSecond))
429 {
430 // Return if the maximum number of waypoints per second has been exceeded.
431 return;
432 }
433
434 // Add the waypoints to the vector or double pairs at the given layer name in the map.
435 for (const geoops::UTMCoordinate& stCoordinate : vCoordinates)
436 {
437 m_umPathMap[szLayerName].emplace_back(stCoordinate.dEasting, stCoordinate.dNorthing);
438 }
439
440 // Update the plot.
441 this->UpdatePlot();
442 }
443
444
457 void AddPathPoints(const std::vector<geoops::GPSCoordinate>& vCoordinates, const std::string& szLayerName, const uint unMaxUpdatesPerSecond = 1)
458 {
459 // Check the update time.
460 if (!this->CheckPathUpdateTime(szLayerName, unMaxUpdatesPerSecond))
461 {
462 // Return if the maximum number of waypoints per second has been exceeded.
463 return;
464 }
465
466 // Add the waypoints to the vector or double pairs at the given layer name in the map.
467 for (const geoops::GPSCoordinate& stCoordinate : vCoordinates)
468 {
469 geoops::UTMCoordinate stUTMCoordinate = geoops::ConvertGPSToUTM(stCoordinate);
470 m_umPathMap[szLayerName].emplace_back(stUTMCoordinate.dEasting, stUTMCoordinate.dNorthing);
471 }
472
473 // Update the plot.
474 this->UpdatePlot();
475 }
476
477
491 void AddDot(const geoops::Waypoint& stWaypoint, const std::string& szLayerName, const uint nMaxWaypointsPerSecond = 1)
492 {
493 // Check the update time.
494 if (!this->CheckDotUpdateTime(szLayerName, nMaxWaypointsPerSecond))
495 {
496 // Return if the maximum number of waypoints per second has been exceeded.
497 return;
498 }
499
500 // Check the radius of the waypoint. It shouldn't be less than 0.
501 if (stWaypoint.dRadius <= 0)
502 {
503 m_umDotMap[szLayerName].emplace_back(stWaypoint.GetUTMCoordinate().dEasting, stWaypoint.GetUTMCoordinate().dNorthing, 5);
504 }
505 else
506 {
507 m_umDotMap[szLayerName].emplace_back(stWaypoint.GetUTMCoordinate().dEasting, stWaypoint.GetUTMCoordinate().dNorthing, stWaypoint.dRadius);
508 }
509
510 // Update the plot.
511 this->UpdatePlot();
512 }
513
514
527 void AddDot(const geoops::UTMCoordinate& stCoordinate, const std::string& szLayerName, const uint nMaxWaypointsPerSecond = 1, const double dDotRadius = 5)
528 {
529 // Check the update time.
530 if (!this->CheckDotUpdateTime(szLayerName, nMaxWaypointsPerSecond))
531 {
532 // Return if the maximum number of waypoints per second has been exceeded.
533 return;
534 }
535
536 // Add the waypoint to the path.
537 m_umDotMap[szLayerName].emplace_back(stCoordinate.dEasting, stCoordinate.dNorthing, dDotRadius);
538
539 // Update the plot.
540 this->UpdatePlot();
541 }
542
543
556 void AddDot(const geoops::GPSCoordinate& stCoordinate, const std::string& szLayerName, const uint nMaxWaypointsPerSecond = 1, const double dDotRadius = 5)
557 {
558 // Check the update time.
559 if (!this->CheckDotUpdateTime(szLayerName, nMaxWaypointsPerSecond))
560 {
561 // Return if the maximum number of waypoints per second has been exceeded.
562 return;
563 }
564
565 // Create instance variables.
566 geoops::UTMCoordinate stUTMCoordinate = geoops::ConvertGPSToUTM(stCoordinate);
567
568 // Add the waypoint to the path.
569 m_umDotMap[szLayerName].emplace_back(stUTMCoordinate.dEasting, stUTMCoordinate.dNorthing, dDotRadius);
570
571 // Update the plot.
572 this->UpdatePlot();
573 }
574
575
590 void AddDots(const std::vector<geoops::Waypoint>& stWaypoints, const std::string& szLayerName, const uint unMaxUpdatesPerSecond = 1)
591 {
592 // Check the update time.
593 if (!this->CheckDotUpdateTime(szLayerName, unMaxUpdatesPerSecond))
594 {
595 // Return if the maximum number of waypoints per second has been exceeded.
596 return;
597 }
598
599 // Add the waypoints to the vector or double pairs at the given layer name in the map.
600 for (const geoops::Waypoint& stWaypoint : stWaypoints)
601 {
602 // Check the radius of the waypoint. It shouldn't be less than 0.
603 if (stWaypoint.dRadius <= 0)
604 {
605 m_umDotMap[szLayerName].emplace_back(stWaypoint.GetUTMCoordinate().dEasting, stWaypoint.GetUTMCoordinate().dNorthing, 5);
606 }
607 else
608 {
609 m_umDotMap[szLayerName].emplace_back(stWaypoint.GetUTMCoordinate().dEasting, stWaypoint.GetUTMCoordinate().dNorthing, stWaypoint.dRadius);
610 }
611 }
612
613 // Update the plot.
614 this->UpdatePlot();
615 }
616
617
631 void AddDots(const std::vector<geoops::UTMCoordinate>& vCoordinates,
632 const std::string& szLayerName,
633 const uint unMaxUpdatesPerSecond = 1,
634 const double dDotRadius = 5)
635 {
636 // Check the update time.
637 if (!this->CheckDotUpdateTime(szLayerName, unMaxUpdatesPerSecond))
638 {
639 // Return if the maximum number of waypoints per second has been exceeded.
640 return;
641 }
642
643 // Add the waypoints to the vector or double pairs at the given layer name in the map.
644 for (const geoops::UTMCoordinate& stCoordinate : vCoordinates)
645 {
646 m_umDotMap[szLayerName].emplace_back(stCoordinate.dEasting, stCoordinate.dNorthing, dDotRadius);
647 }
648
649 // Update the plot.
650 this->UpdatePlot();
651 }
652
653
667 void AddDots(const std::vector<geoops::GPSCoordinate>& vCoordinates,
668 const std::string& szLayerName,
669 const uint unMaxUpdatesPerSecond = 1,
670 const double dDotRadius = 5)
671 {
672 // Check the update time.
673 if (!this->CheckDotUpdateTime(szLayerName, unMaxUpdatesPerSecond))
674 {
675 // Return if the maximum number of waypoints per second has been exceeded.
676 return;
677 }
678
679 // Add the waypoints to the vector or double pairs at the given layer name in the map.
680 for (const geoops::GPSCoordinate& stCoordinate : vCoordinates)
681 {
682 geoops::UTMCoordinate stUTMCoordinate = geoops::ConvertGPSToUTM(stCoordinate);
683 m_umDotMap[szLayerName].emplace_back(stUTMCoordinate.dEasting, stUTMCoordinate.dNorthing, dDotRadius);
684 }
685
686 // Update the plot.
687 this->UpdatePlot();
688 }
689
690 private:
691 // Declare private member variables.
692 matplot::figure_handle m_mtRoverPathPlot;
693 matplot::axes_handle m_mtRoverPathAxes;
694 std::unordered_map<std::string, std::string> m_umPathLineStyleMap;
695 std::unordered_map<std::string, std::pair<std::string, bool>> m_umDotLineStyleMap;
696 std::unordered_map<std::string, std::chrono::system_clock::time_point> m_umLastPlotUpdateTimeMap;
697 std::unordered_map<std::string, std::chrono::system_clock::time_point> m_umLastDotUpdateTimeMap;
698 std::unordered_map<std::string, std::vector<std::pair<double, double>>> m_umPathMap;
699 std::unordered_map<std::string, std::vector<std::tuple<double, double, double>>> m_umDotMap;
700 std::string m_szPlotTitle;
701 std::string m_szCurrentPlotSavePath;
702
703
711 {
712 // Create instance variables.
713 std::vector<std::string> vLayerNames;
714
715 // Clear the plot.
716 m_mtRoverPathAxes->clear();
717
718 /*
719 PATHS
720 */
721 // Loop through each of the layer name keys in the map.
722 for (const std::pair<const std::string, const std::string>& stdLayer : m_umPathLineStyleMap)
723 {
724 // Check if the vector or coordinates has more than one point.
725 if (m_umPathMap[stdLayer.first].size() > 1)
726 {
727 // Add the layer name to the vector.
728 vLayerNames.push_back(stdLayer.first);
729
730 // Get the x and y coordinates for the layer.
731 std::vector<double> vEasting, vNorthing;
732 for (const std::pair<double, double>& stCoordinate : m_umPathMap[stdLayer.first])
733 {
734 vEasting.push_back(stCoordinate.first);
735 vNorthing.push_back(stCoordinate.second);
736 }
737
738 // Plot the path.
739 m_mtRoverPathAxes->plot(vEasting, vNorthing, std::string_view(stdLayer.second));
740 // Set the hold to true.
741 m_mtRoverPathAxes->hold(true);
742 }
743 }
744
745 /*
746 DOTS
747 */
748 // Loop through each of the layer name keys in the map.
749 for (const std::pair<const std::string, const std::pair<std::string, bool>>& stdLayer : m_umDotLineStyleMap)
750 {
751 // Check if the vector or coordinates has at least one point.
752 if (m_umDotMap[stdLayer.first].size() > 0)
753 {
754 // Add the layer name to the vector.
755 vLayerNames.push_back(stdLayer.first);
756
757 // Get the x and y coordinates for the layer.
758 std::vector<double> vEasting, vNorthing, vRadius;
759 for (const std::tuple<double, double, double>& stCoordinate : m_umDotMap[stdLayer.first])
760 {
761 vEasting.push_back(std::get<0>(stCoordinate));
762 vNorthing.push_back(std::get<1>(stCoordinate));
763 vRadius.push_back(std::get<2>(stCoordinate));
764 }
765
766 // Plot the path.
767 matplot::line_handle mtLineHandle = m_mtRoverPathAxes->scatter(vEasting, vNorthing, vRadius);
768 mtLineHandle->color(stdLayer.second.first);
769 mtLineHandle->marker_face(stdLayer.second.second);
770 // Set the hold to true.
771 m_mtRoverPathAxes->hold(true);
772 }
773 }
774
775 // Update legend names.
776 m_mtRoverPathAxes->legend(vLayerNames);
777 matplot::legend_handle mtLegend = m_mtRoverPathAxes->legend();
778 mtLegend->font_size(8);
779 mtLegend->num_columns(2);
780 // Set axis options.
781 m_mtRoverPathAxes->grid(true);
782 m_mtRoverPathAxes->xtickangle(45);
783 m_mtRoverPathAxes->axis(matplot::square);
784 m_mtRoverPathAxes->xtickformat("%.0f"); // No decimal places for x-axis
785 m_mtRoverPathAxes->ytickformat("%.0f"); // No decimal places for y-axis
786 // Set the hold to false.
787 m_mtRoverPathAxes->hold(false);
788 // Plot the path.
789 m_mtRoverPathPlot->draw();
790 m_mtRoverPathPlot->save(m_szCurrentPlotSavePath);
791 }
792
793
809 bool CheckPathUpdateTime(const std::string& szLayerName, const uint unMaxUpdatesPerSecond)
810 {
811 // Check if the layer name exists in the map.
812 if (m_umLastPlotUpdateTimeMap.find(szLayerName) == m_umLastPlotUpdateTimeMap.end())
813 {
814 // Submit logger message.
815 LOG_WARNING(logging::g_qSharedLogger, "Layer does not exist. Cannot add waypoints.");
816 return false;
817 }
818
819 // Check if the maximum number of waypoints per second has been exceeded.
820 if (unMaxUpdatesPerSecond != 0 &&
821 std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - m_umLastPlotUpdateTimeMap[szLayerName]).count() <
822 1.0 / unMaxUpdatesPerSecond)
823 {
824 // Return if the maximum number of waypoints per second has been exceeded.
825 return false;
826 }
827
828 // Update the last plot time.
829 m_umLastPlotUpdateTimeMap[szLayerName] = std::chrono::system_clock::now();
830
831 // Return true.
832 return true;
833 }
834
835
851 bool CheckDotUpdateTime(const std::string& szLayerName, const uint unMaxUpdatesPerSecond)
852 {
853 // Check if the layer name exists in the map.
854 if (m_umLastDotUpdateTimeMap.find(szLayerName) == m_umLastDotUpdateTimeMap.end())
855 {
856 // Submit logger message.
857 LOG_WARNING(logging::g_qSharedLogger, "Layer does not exist. Cannot add waypoints.");
858 return false;
859 }
860
861 // Check if the maximum number of waypoints per second has been exceeded.
862 if (unMaxUpdatesPerSecond != 0 &&
863 std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - m_umLastDotUpdateTimeMap[szLayerName]).count() <
864 1.0 / unMaxUpdatesPerSecond)
865 {
866 // Return if the maximum number of waypoints per second has been exceeded.
867 return false;
868 }
869
870 // Update the last plot time.
871 m_umLastDotUpdateTimeMap[szLayerName] = std::chrono::system_clock::now();
872
873 // Return true.
874 return true;
875 }
876 };
877 } // namespace graphing
878} // namespace logging
879
880#endif
The PathTracer class is used to trace the path of the rover and plot the path on a 2D graph.
Definition PathTracer2D.hpp:53
bool CheckPathUpdateTime(const std::string &szLayerName, const uint unMaxUpdatesPerSecond)
Checks the unordered map of last update times for a given layer name and returns true if the time sin...
Definition PathTracer2D.hpp:809
~PathTracer()
Destroy the Path Tracer object.
Definition PathTracer2D.hpp:109
bool CreatePathLayer(const std::string &szLayerName, const std::string &szStyleString="-o")
Add a new draw layer to the plot.
Definition PathTracer2D.hpp:166
void AddPathPoints(const std::vector< geoops::Waypoint > &stWaypoints, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1)
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints tha...
Definition PathTracer2D.hpp:393
bool ClearLayer(const std::string &szLayerName)
Clear the path or dots of a layer.
Definition PathTracer2D.hpp:270
void AddDot(const geoops::UTMCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1, const double dDotRadius=5)
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be a...
Definition PathTracer2D.hpp:527
void AddDot(const geoops::Waypoint &stWaypoint, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1)
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be a...
Definition PathTracer2D.hpp:491
void UpdatePlot()
Update the plot with the new waypoints and redraw the plot.
Definition PathTracer2D.hpp:710
PathTracer(const std::string &szPlotTitle="Graph")
Construct a new Path Tracer object.
Definition PathTracer2D.hpp:62
void AddPathPoint(const geoops::UTMCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1)
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that...
Definition PathTracer2D.hpp:333
void AddDots(const std::vector< geoops::UTMCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1, const double dDotRadius=5)
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be ...
Definition PathTracer2D.hpp:631
void AddPathPoints(const std::vector< geoops::GPSCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1)
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints tha...
Definition PathTracer2D.hpp:457
void AddDots(const std::vector< geoops::Waypoint > &stWaypoints, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1)
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be ...
Definition PathTracer2D.hpp:590
bool CheckDotUpdateTime(const std::string &szLayerName, const uint unMaxUpdatesPerSecond)
Checks the unordered map of last update times for a given layer name and returns true if the time sin...
Definition PathTracer2D.hpp:851
void AddPathPoint(const geoops::GPSCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1)
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that...
Definition PathTracer2D.hpp:361
void AddDot(const geoops::GPSCoordinate &stCoordinate, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1, const double dDotRadius=5)
Add a waypoint as a dot to the path. This method has a limit to the number of waypoints that can be a...
Definition PathTracer2D.hpp:556
bool DeleteLayer(const std::string &szLayerName)
Delete a draw layer from the plot.
Definition PathTracer2D.hpp:233
void AddDots(const std::vector< geoops::GPSCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1, const double dDotRadius=5)
Add a waypoint as a dot to the path. This method has no limit to the number of waypoints that can be ...
Definition PathTracer2D.hpp:667
void AddPathPoints(const std::vector< geoops::UTMCoordinate > &vCoordinates, const std::string &szLayerName, const uint unMaxUpdatesPerSecond=1)
Add a waypoint to the path and plot the path. This method has no limit to the number of waypoints tha...
Definition PathTracer2D.hpp:425
void AddPathPoint(const geoops::Waypoint &stWaypoint, const std::string &szLayerName, const uint nMaxWaypointsPerSecond=1)
Add a waypoint to the path and plot the path. This method has a limit to the number of waypoints that...
Definition PathTracer2D.hpp:305
bool CreateDotLayer(const std::string &szLayerName, const std::string &szColorString="blue", const bool bFillMarkerFace=true)
Add a new draw layer to the plot.
Definition PathTracer2D.hpp:205
uint32_t uint
UTMCoordinate ConvertGPSToUTM(const GPSCoordinate &stGPSCoord)
Given a GPS coordinate, convert to UTM and create a new UTMCoordinate object.
Definition GeospatialOperations.hpp:302
Namespace containing all global type/structs that will be used project wide for logging.
Definition AutonomyLogging.cpp:34
This struct stores/contains information about a GPS data.
Definition GeospatialOperations.hpp:99
This struct stores/contains information about a UTM coordinate.
Definition GeospatialOperations.hpp:195
This struct is used by the WaypointHandler class to store location, size, and type information about ...
Definition GeospatialOperations.hpp:392
const geoops::UTMCoordinate & GetUTMCoordinate() const
Accessor for the geoops::UTMCoordinate member variable.
Definition GeospatialOperations.hpp:477