Skip to content
Snippets Groups Projects
Commit 55ed9cb8 authored by Tobias Gröger's avatar Tobias Gröger
Browse files

Add sciplot to test

To use sciplot it has to be installed locally. For example install it locally
like described in https://sciplot.github.io/installation/ under Installation using CMake.
parent ee6ebb52
No related branches found
No related tags found
3 merge requests!68Add human tracking,!53Draft: Implement basic version of kalman filter for human tracking,!28Draft: Dev -> Main
......@@ -44,6 +44,8 @@ armarx_add_component(dynamic_scene_provider
# SHARED_COMPONENT_LIBRARY
)
find_package(sciplot)
armarx_add_test(kalman_test
TEST_FILES
test/kalmanFilterTest.cpp
......@@ -51,4 +53,5 @@ armarx_add_test(kalman_test
PUBLIC
ArmarXCore
armarx_navigation::teb_human
sciplot::sciplot
)
......@@ -32,9 +32,9 @@
#include <RobotAPI/libraries/ukfm/UnscentedKalmanFilter.h>
#include <armarx/navigation/Test.h>
#include <armarx/navigation/components/dynamic_scene_provider/sciplot/sciplot.hpp>
#include <armarx/navigation/human/HumanSystemModel.h>
#include <manif/SO2.h>
#include <sciplot/sciplot.hpp>
namespace armarx::navigation::components::dynamic_scene_provider
......@@ -211,35 +211,38 @@ namespace armarx::navigation::components::dynamic_scene_provider
TIMING_END(LOOP);
}
/*
sciplot::Plot3D position_plot;
sciplot::Plot pos_plot;
position_plot.drawCurve(x_true, y_true, z_true).label("True").lineWidth(1);
position_plot.drawCurve(x_obs, y_obs, z_obs).label("Obs").lineWidth(1);
position_plot.drawCurve(x_ukf, y_ukf, z_ukf).label("UKF").lineWidth(1);
sciplot::Plot2D pos_plot;
pos_plot.xlabel("x");
pos_plot.ylabel("y");
pos_plot.legend().atOutsideBottom().displayHorizontal().displayExpandWidthBy(2);
pos_plot.drawCurve(x_true, y_true).label("True");
pos_plot.drawCurve(x_obs, y_obs).label("Obs");
pos_plot.drawCurve(x_ukf, y_ukf).label("UKF");
// sciplot::Plot3D vel_plot;
//
// vel_plot.drawCurve(vx_true, vy_true, vz_true).label("True").lineWidth(1);
// vel_plot.drawCurve(vx_ukf, vy_ukf, vz_ukf).label("UKF").lineWidth(1);
sciplot::Plot2D orientation_plot;
orientation_plot.xlabel("x");
orientation_plot.ylabel("y");
orientation_plot.legend().atOutsideBottom().displayHorizontal().displayExpandWidthBy(2);
sciplot::Vec x = sciplot::linspace(0.0, 1.0, a_true.size());
orientation_plot.drawCurve(x, a_true).label("True").lineWidth(1);
orientation_plot.drawCurve(x, a_obs).label("Obs").lineWidth(1);
orientation_plot.drawCurve(x, a_ukf).label("UKF").lineWidth(1);
sciplot::Plot3D orientation_plot;
orientation_plot.drawCurve(a_true, b_true, c_true).label("True").lineWidth(1);
orientation_plot.drawCurve(a_obs, b_obs, c_obs).label("Obs").lineWidth(1);
orientation_plot.drawCurve(a_ukf, b_ukf, c_ukf).label("UKF").lineWidth(1);
// Create figure to hold plot
sciplot::Figure fig = {{pos_plot}, {orientation_plot}};
// Create canvas to hold figure
sciplot::Canvas canvas = {{fig}};
canvas.size(600, 600);
pos_plot.show();
position_plot.show();
// vel_plot.show();
orientation_plot.show();
*/
// Show the plot in a pop-up window
canvas.show();
// Save the plot to a PDF file
canvas.save("kalman_output.pdf");
}
} // namespace armarx::navigation::components::dynamic_scene_provider
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment