38 bool space_before = keyboard.query(SDLK_SPACE);
39 bool d_before = keyboard.query(SDLK_d);
40 bool i_before = keyboard.query(SDLK_i);
41 keyboard.update(event);
42 bool space_after = keyboard.query(SDLK_SPACE);
43 bool d_after = keyboard.query(SDLK_d);
44 bool i_after = keyboard.query(SDLK_i);
46 if (!space_before && space_after) {
47 is_iterating = !is_iterating;
49 if (!i_before && i_after) {
52 if (!d_before && d_after) {
53 std::cerr <<
"DEBUG PRINT:\n";
54 std::cerr <<
"icp->current_transform() = " <<
icp->current_transform().to_string() <<
'\n';
55 std::cerr <<
"icp->calculate_cost() = " <<
icp->calculate_cost() <<
'\n';
56 std::cerr <<
"iterations = " << iterations <<
'\n';
60void LidarView::draw(SDL_Renderer* renderer,
const SDL_Rect* frame,
double dtime) {
62 SDL_SetRenderDrawColor(renderer, 100, 100, 100, 255);
64 SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
66 SDL_RenderClear(renderer);
68 SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE);
74 SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
82 SDL_SetRenderDrawColor(renderer, 255, 0, 0, 10);
87 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...