18 std::unique_ptr<icp::ICP>
icp)
20 destination(destination),
34 bool space_before = keyboard.query(SDLK_SPACE);
35 bool d_before = keyboard.query(SDLK_d);
36 bool i_before = keyboard.query(SDLK_i);
37 keyboard.update(event);
38 bool space_after = keyboard.query(SDLK_SPACE);
39 bool d_after = keyboard.query(SDLK_d);
40 bool i_after = keyboard.query(SDLK_i);
42 if (!space_before && space_after) {
43 is_iterating = !is_iterating;
45 if (!i_before && i_after) {
48 if (!d_before && d_after) {
49 std::cerr <<
"DEBUG PRINT:\n";
50 std::cerr <<
"icp->current_transform() = " <<
icp->current_transform().to_string() <<
'\n';
51 std::cerr <<
"icp->calculate_cost() = " <<
icp->calculate_cost() <<
'\n';
52 std::cerr <<
"iterations = " << iterations <<
'\n';
56void LidarView::draw(SDL_Renderer* renderer, [[maybe_unused]]
const SDL_Rect* frame,
57 [[maybe_unused]]
double dtime) {
59 SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
61 SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
63 SDL_RenderClear(renderer);
65 SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE);
71 SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
79 SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
84 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...