17 std::unique_ptr<icp::ICP>
icp)
19 destination(destination),
33 bool space_before = keyboard.query(SDLK_SPACE);
34 bool d_before = keyboard.query(SDLK_d);
35 bool i_before = keyboard.query(SDLK_i);
36 keyboard.update(event);
37 bool space_after = keyboard.query(SDLK_SPACE);
38 bool d_after = keyboard.query(SDLK_d);
39 bool i_after = keyboard.query(SDLK_i);
41 if (!space_before && space_after) {
42 is_iterating = !is_iterating;
44 if (!i_before && i_after) {
47 if (!d_before && d_after) {
48 std::cerr <<
"DEBUG PRINT:\n";
49 std::cerr <<
"icp->current_transform() = " <<
icp->current_transform().to_string() <<
'\n';
50 std::cerr <<
"icp->calculate_cost() = " <<
icp->calculate_cost() <<
'\n';
51 std::cerr <<
"iterations = " << iterations <<
'\n';
55void LidarView::draw(SDL_Renderer* renderer, [[maybe_unused]]
const SDL_Rect* frame,
56 [[maybe_unused]]
double dtime) {
58 SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
60 SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
62 SDL_RenderClear(renderer);
64 SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE);
70 SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
78 SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
83 SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE);
LidarView(std::vector< icp::Vector > source, std::vector< icp::Vector > destination, std::unique_ptr< icp::ICP > icp)
Constructs a new lidar view visualizing ICP (by method method) on the given instance (source and dest...