Skip to content

Commit

Permalink
Update basic mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Yey007 committed Nov 13, 2024
1 parent 8775710 commit 8ea4aaa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions lib/icp/impl/feature_aware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ namespace icp {
a_current[i] = transform.apply_to(a[i]);
}

auto a_current_cm = get_centroid(a_current);

/* TODO: write smth #step Matching Step: */
Eigen::MatrixXd norm_dists = compute_norm_dists(a_current, b);

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int main(int argc, const char** argv) {
Log.is_enabled = *enable_log;
parse_config(config_file, set_config_param, NULL);
if (*basic_mode) {
view_config::use_light_background = true;
view_config::use_light_mode = true;
}

icp::ICP::register_builtin_methods();
Expand Down
10 changes: 5 additions & 5 deletions src/sim/lidar_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ void LidarView::on_event(const SDL_Event& event) {

void LidarView::draw(SDL_Renderer* renderer, [[maybe_unused]] const SDL_Rect* frame,
[[maybe_unused]] double dtime) {
if (view_config::use_light_background) {
SDL_SetRenderDrawColor(renderer, 100, 100, 100, 255);
if (view_config::use_light_mode) {
SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE);
} else {
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
}
SDL_RenderClear(renderer);

Expand All @@ -80,12 +80,12 @@ void LidarView::draw(SDL_Renderer* renderer, [[maybe_unused]] const SDL_Rect* fr
}

icp::Vector a_cm = icp->current_transform().apply_to(icp::get_centroid(source));
SDL_SetRenderDrawColor(renderer, 255, 0, 0, 10);
SDL_SetRenderDrawColor(renderer, 255, 0, 0, SDL_ALPHA_OPAQUE);
SDL_DrawCircle(renderer, a_cm.x() + view_config::x_displace, a_cm.y() + view_config::y_displace,
20);

icp::Vector b_cm = icp::get_centroid(destination);
SDL_SetRenderDrawColor(renderer, 0, 0, 255, 10);
SDL_SetRenderDrawColor(renderer, 0, 0, 255, SDL_ALPHA_OPAQUE);
SDL_DrawCircle(renderer, b_cm.x() + view_config::x_displace, b_cm.y() + view_config::y_displace,
20);

Expand Down
2 changes: 1 addition & 1 deletion src/sim/view_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ namespace view_config {
double x_displace = 100;
double y_displace = 50;

bool use_light_background = false;
bool use_light_mode = false;
}
2 changes: 1 addition & 1 deletion src/sim/view_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ namespace view_config {
extern double x_displace;
extern double y_displace;

extern bool use_light_background;
extern bool use_light_mode;
}

0 comments on commit 8ea4aaa

Please sign in to comment.