18 std::vector<icp::Vector> destination,
const std::string method,
20 : source(source), destination(destination), keyboard(false), iterations{} {
30 bool space_before = keyboard.query(SDLK_SPACE);
31 bool d_before = keyboard.query(SDLK_d);
32 keyboard.update(event);
33 bool space_after = keyboard.query(SDLK_SPACE);
34 bool d_after = keyboard.query(SDLK_d);
36 if (!space_before && space_after) {
37 is_iterating = !is_iterating;
39 if (!d_before && d_after) {
40 std::cerr <<
"DEBUG PRINT:\n";
41 std::cerr <<
"icp->current_transform() = "
42 <<
icp->current_transform().to_string() <<
'\n';
43 std::cerr <<
"icp->calculate_cost() = " <<
icp->calculate_cost()
45 std::cerr <<
"iterations = " << iterations <<
'\n';
50 double dtime __unused) {
52 SDL_SetRenderDrawColor(renderer, 100, 100, 100, 255);
54 SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
56 SDL_RenderClear(renderer);
58 SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE);
64 SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
73 SDL_SetRenderDrawColor(renderer, 255, 0, 0, 10);
78 SDL_SetRenderDrawColor(renderer, 0, 0, 255, 10);
LidarView(std::vector< icp::Vector > source, std::vector< icp::Vector > destination, const std::string method, const icp::ICP::Config &config=icp::ICP::Config())
Constructs a new lidar view visualizing ICP (by method method) on the given instance (source and dest...