diff --git a/src/dbastar/dbastar.cpp b/src/dbastar/dbastar.cpp index 668c037..8fde1cd 100644 --- a/src/dbastar/dbastar.cpp +++ b/src/dbastar/dbastar.cpp @@ -288,8 +288,8 @@ void from_solution_to_yaml_and_traj(dynobench::Model_robot &robot, } DYNO_CHECK_LEQ(take_num_actions, motion.actions.size(), AT); if (out) { - *out << space6 + "# " - << "take_num_actions " << take_num_actions << std::endl; + *out << space6 + "# " << "take_num_actions " << take_num_actions + << std::endl; } for (size_t k = 0; k < take_num_actions; ++k) { @@ -703,22 +703,19 @@ void dbastar(const dynobench::Problem &problem, Options_dbastar options_dbastar, if (static_cast(time_bench.expands) >= options_dbastar.max_expands) { status = Terminate_status::MAX_EXPANDS; - std::cout << "BREAK search:" - << "MAX_EXPANDS" << std::endl; + std::cout << "BREAK search:" << "MAX_EXPANDS" << std::endl; return true; } if (watch.elapsed_ms() > options_dbastar.search_timelimit) { status = Terminate_status::MAX_TIME; - std::cout << "BREAK search:" - << "MAX_TIME" << std::endl; + std::cout << "BREAK search:" << "MAX_TIME" << std::endl; return true; } if (open.empty()) { status = Terminate_status::EMPTY_QUEUE; - std::cout << "BREAK search:" - << "EMPTY_QUEUE" << std::endl; + std::cout << "BREAK search:" << "EMPTY_QUEUE" << std::endl; return true; } diff --git a/src/dbrrt/dbrrt.cpp b/src/dbrrt/dbrrt.cpp index 264deda..434b0ae 100644 --- a/src/dbrrt/dbrrt.cpp +++ b/src/dbrrt/dbrrt.cpp @@ -497,16 +497,14 @@ void dbrrtConnect(const dynobench::Problem &problem, auto stop_search = [&] { if (static_cast(time_bench.expands) >= options_dbrrt.max_expands) { status = Terminate_status::MAX_EXPANDS; - std::cout << "BREAK search:" - << "MAX_EXPANDS" << std::endl; + std::cout << "BREAK search:" << "MAX_EXPANDS" << std::endl; return true; } if (watch.elapsed_ms() > options_dbrrt.timelimit) { status = Terminate_status::MAX_TIME; - std::cout << "BREAK search:" - << "MAX_TIME" << std::endl; + std::cout << "BREAK search:" << "MAX_TIME" << std::endl; return true; } return false; @@ -1051,16 +1049,14 @@ void dbrrt(const dynobench::Problem &problem, auto stop_search = [&] { if (static_cast(time_bench.expands) >= options_dbrrt.max_expands) { status = Terminate_status::MAX_EXPANDS; - std::cout << "BREAK search:" - << "MAX_EXPANDS" << std::endl; + std::cout << "BREAK search:" << "MAX_EXPANDS" << std::endl; return true; } if (watch.elapsed_ms() > options_dbrrt.timelimit) { status = Terminate_status::MAX_TIME; - std::cout << "BREAK search:" - << "MAX_TIME" << std::endl; + std::cout << "BREAK search:" << "MAX_TIME" << std::endl; return true; } return false; @@ -1120,9 +1116,8 @@ void dbrrt(const dynobench::Problem &problem, if (options_dbrrt.ao_rrt && near_node->gScore + near_node->hScore > options_dbrrt.best_cost_prune_factor * cost_bound) { - std::cout << "warning! " - << "cost of near is above bound -- " << near_node->gScore << " " - << cost_bound << std::endl; + std::cout << "warning! " << "cost of near is above bound -- " + << near_node->gScore << " " << cost_bound << std::endl; continue; } diff --git a/src/idbastar/idbastar.cpp b/src/idbastar/idbastar.cpp index 0cb8e50..17846f5 100644 --- a/src/idbastar/idbastar.cpp +++ b/src/idbastar/idbastar.cpp @@ -280,8 +280,8 @@ void idbA(const dynobench::Problem &problem, std::make_move_iterator(motions_out.end())); std::cout << "Afer insert " << motions.size() << std::endl; - std::cout << "Warning: " - << "I am inserting at the beginning" << std::endl; + std::cout << "Warning: " << "I am inserting at the beginning" + << std::endl; std::cout << "i update the idx of the motions " << std::endl; // Very important to update the idx of the motions diff --git a/src/motion_primitives/main_primitives.cpp b/src/motion_primitives/main_primitives.cpp index e4e8212..71f4637 100644 --- a/src/motion_primitives/main_primitives.cpp +++ b/src/motion_primitives/main_primitives.cpp @@ -379,8 +379,7 @@ int main(int argc, const char *argv[]) { } CSTR_(trajectories.data.size()); trajectories.compute_stats(out_file.c_str()); - std::cout << "writing stats to " - << "/tmp/tmp_stats.yaml" << std::endl; + std::cout << "writing stats to " << "/tmp/tmp_stats.yaml" << std::endl; std::filesystem::copy(out_file, "/tmp/tmp_stats.yaml", std::filesystem::copy_options::overwrite_existing); } diff --git a/src/motion_primitives/motion_primitives.cpp b/src/motion_primitives/motion_primitives.cpp index faee48d..6c674f3 100644 --- a/src/motion_primitives/motion_primitives.cpp +++ b/src/motion_primitives/motion_primitives.cpp @@ -334,8 +334,8 @@ void split_motion_primitives(const dynobench::Trajectories &in, } dynobench::Trajectory new_traj; - std::cout << "i: " << i << " " - << "start: " << start << " length:" << length << std::endl; + std::cout << "i: " << i << " " << "start: " << start + << " length:" << length << std::endl; new_traj.states = std::vector{ traj.states.begin() + start, traj.states.begin() + start + length + 1}; diff --git a/src/ompl/robots.cpp b/src/ompl/robots.cpp index 905700e..1f85981 100644 --- a/src/ompl/robots.cpp +++ b/src/ompl/robots.cpp @@ -3114,8 +3114,8 @@ void load_motion_primitives_new(const std::string &motionsFile, CSTR_(add_noise_first_state); if (add_noise_first_state) { - std::cout << "WARNING:" - << "adding noise to first and last state" << std::endl; + std::cout << "WARNING:" << "adding noise to first and last state" + << std::endl; const double noise = 1e-7; for (auto &t : trajs.data) { t.states.front() += diff --git a/src/ompl/sst.cpp b/src/ompl/sst.cpp index 0471bd5..ddad3e8 100644 --- a/src/ompl/sst.cpp +++ b/src/ompl/sst.cpp @@ -422,10 +422,8 @@ void solve_sst(const dynobench::Problem &problem, auto &state = states.at(i); auto &edge = edges.at(i); out << "- " << std::endl; - out << " " - << "x: " << state.format(FMT) << std::endl; - out << " " - << "e: "; + out << " " << "x: " << state.format(FMT) << std::endl; + out << " " << "e: "; print_vec(edge.data(), edge.size(), out); } } diff --git a/src/optimization/croco_models.cpp b/src/optimization/croco_models.cpp index de6e6bd..4d3bcb3 100644 --- a/src/optimization/croco_models.cpp +++ b/src/optimization/croco_models.cpp @@ -165,21 +165,21 @@ void check_input_calc(Eigen::Ref xnext, const Eigen::Ref &u, size_t nx, size_t nu) { if (static_cast(x.size()) != nx) { - throw_pretty("Invalid argument: " - << "x has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "x has wrong dimension (it should be " + + std::to_string(nx) + ")"); } if (static_cast(u.size()) != nu) { - throw_pretty("Invalid argument: " - << "x has wrong dimension (it should be " + - std::to_string(nu) + ")"); + throw_pretty( + "Invalid argument: " << "x has wrong dimension (it should be " + + std::to_string(nu) + ")"); } if (static_cast(xnext.size()) != nx) { - throw_pretty("Invalid argument: " - << "xnext has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "xnext has wrong dimension (it should be " + + std::to_string(nx) + ")"); } }; @@ -190,38 +190,38 @@ void check_input_calcdiff(Eigen::Ref Fx, size_t nu) { if (static_cast(x.size()) != nx) { - throw_pretty("Invalid argument: " - << "x has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "x has wrong dimension (it should be " + + std::to_string(nx) + ")"); } if (static_cast(u.size()) != nu) { - throw_pretty("Invalid argument: " - << "u has wrong dimension (it should be " + - std::to_string(nu) + ")"); + throw_pretty( + "Invalid argument: " << "u has wrong dimension (it should be " + + std::to_string(nu) + ")"); } if (static_cast(Fx.cols()) != nx) { - throw_pretty("Invalid argument: " - << "Fx has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "Fx has wrong dimension (it should be " + + std::to_string(nx) + ")"); } if (static_cast(Fx.rows()) != nx) { - throw_pretty("Invalid argument: " - << "Fx has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "Fx has wrong dimension (it should be " + + std::to_string(nx) + ")"); } if (static_cast(Fu.cols()) != nu) { - throw_pretty("Invalid argument: " - << "Fu has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "Fu has wrong dimension (it should be " + + std::to_string(nx) + ")"); } if (static_cast(Fu.rows()) != nx) { - throw_pretty("Invalid argument: " - << "Fu has wrong dimension (it should be " + - std::to_string(nx) + ")"); + throw_pretty( + "Invalid argument: " << "Fu has wrong dimension (it should be " + + std::to_string(nx) + ")"); } } @@ -1043,10 +1043,10 @@ int get_additional_nu(Control_Mode control_mode) { boost::shared_ptr mk_state_croco(std::shared_ptr model_robot, - Control_Mode control_mode){}; + Control_Mode control_mode) {}; int get_nx(std::shared_ptr model_robot, - Control_Mode control_mode){}; + Control_Mode control_mode) {}; ActionModelDynov2::ActionModelDynov2( std::shared_ptr model_robot, diff --git a/src/optimization/ocp.cpp b/src/optimization/ocp.cpp index c0e923a..4621a77 100644 --- a/src/optimization/ocp.cpp +++ b/src/optimization/ocp.cpp @@ -614,8 +614,7 @@ void fix_problem_quaternion(Eigen::VectorXd &start, Eigen::VectorXd &goal, double d2 = (xs_init.front().segment<4>(3) + start.segment<4>(3)).norm(); if (d2 < d1) { - std::cout << "WARNING: " - << "i flip the start state" << std::endl; + std::cout << "WARNING: " << "i flip the start state" << std::endl; xs_init.front().segment<4>(3) *= -1.; } @@ -1081,8 +1080,8 @@ void __trajectory_optimization( SOLVER solver = static_cast(options_trajopt_local.solver_id); if (modify_to_match_goal_start) { - std::cout << "WARNING: " - << "i modify last state to match goal" << std::endl; + std::cout << "WARNING: " << "i modify last state to match goal" + << std::endl; xs_init.back() = goal; xs_init.front() = start; } @@ -1649,16 +1648,14 @@ void __trajectory_optimization( if (is_last) { finished = true; - std::cout << "finished: " - << "is_last=TRUE" << std::endl; + std::cout << "finished: " << "is_last=TRUE" << std::endl; } counter++; if (counter > options_trajopt_local.max_mpc_iterations) { finished = true; - std::cout << "finished: " - << "max mpc iterations" << std::endl; + std::cout << "finished: " << "max mpc iterations" << std::endl; } } std::cout << "Total TIME: " << total_time << std::endl; @@ -2088,9 +2085,7 @@ void trajectory_optimization(const dynobench::Problem &problem, CSTR_(time_ddp_total); if (!opti_out.success) { - std::cout << "warning" - << " " - << "not success" << std::endl; + std::cout << "warning" << " " << "not success" << std::endl; do_mpcc = false; break; } @@ -2115,9 +2110,7 @@ void trajectory_optimization(const dynobench::Problem &problem, time_ddp_total += std::stod(opti_out.data.at("ddp_time")); CSTR_(time_ddp_total); if (!opti_out.success) { - std::cout << "warning" - << " " - << "not success" << std::endl; + std::cout << "warning" << " " << "not success" << std::endl; break; } } @@ -2144,9 +2137,7 @@ void trajectory_optimization(const dynobench::Problem &problem, time_ddp_total += std::stod(opti_out.data.at("ddp_time")); CSTR_(time_ddp_total); if (!opti_out.success) { - std::cout << "warning" - << " " - << "not success" << std::endl; + std::cout << "warning" << " " << "not success" << std::endl; do_free_time = false; } @@ -2194,9 +2185,7 @@ void trajectory_optimization(const dynobench::Problem &problem, time_ddp_total += std::stod(opti_out.data.at("ddp_time")); CSTR_(time_ddp_total); if (!opti_out.success) { - std::cout << "warning" - << " " - << "fail first step" << std::endl; + std::cout << "warning" << " " << "fail first step" << std::endl; do_free_time = false; } @@ -2374,8 +2363,7 @@ void trajectory_optimization(const dynobench::Problem &problem, CSTR_(time_ddp_total); if (!opti_out.success) { - std::cout << "warning:" - << "not success" << std::endl; + std::cout << "warning:" << "not success" << std::endl; do_final_repair_step = false; } @@ -2410,9 +2398,7 @@ void trajectory_optimization(const dynobench::Problem &problem, CSTR_(time_ddp_total); if (!opti_out.success) { - std::cout << "warning" - << " " - << "infeasible" << std::endl; + std::cout << "warning" << " " << "infeasible" << std::endl; do_final_repair_step = false; } @@ -2523,9 +2509,7 @@ void trajectory_optimization(const dynobench::Problem &problem, // solve without bounds -- if (!opti_out.success) { - std::cout << "warning" - << " " - << "not success" << std::endl; + std::cout << "warning" << " " << "not success" << std::endl; do_opti_with_real_bounds = false; } diff --git a/src/tdbastar/tdbastar.cpp b/src/tdbastar/tdbastar.cpp index a4522c8..41460bf 100644 --- a/src/tdbastar/tdbastar.cpp +++ b/src/tdbastar/tdbastar.cpp @@ -276,8 +276,8 @@ void from_solution_to_yaml_and_traj(dynobench::Model_robot &robot, } DYNO_CHECK_LEQ(take_num_actions, motion.actions.size(), AT); if (out) { - *out << space6 + "# " - << "take_num_actions " << take_num_actions << std::endl; + *out << space6 + "# " << "take_num_actions " << take_num_actions + << std::endl; } for (size_t k = 0; k < take_num_actions; ++k) { @@ -675,22 +675,19 @@ void tdbastar( if (static_cast(time_bench.expands) >= options_tdbastar.max_expands) { status = Terminate_status::MAX_EXPANDS; - std::cout << "BREAK search:" - << "MAX_EXPANDS" << std::endl; + std::cout << "BREAK search:" << "MAX_EXPANDS" << std::endl; return true; } if (watch.elapsed_ms() > options_tdbastar.search_timelimit) { status = Terminate_status::MAX_TIME; - std::cout << "BREAK search:" - << "MAX_TIME" << std::endl; + std::cout << "BREAK search:" << "MAX_TIME" << std::endl; return true; } if (open.empty()) { status = Terminate_status::EMPTY_QUEUE; - std::cout << "BREAK search:" - << "EMPTY_QUEUE" << std::endl; + std::cout << "BREAK search:" << "EMPTY_QUEUE" << std::endl; return true; } @@ -909,7 +906,7 @@ void tdbastar( break; } } // end of lazy_trajs loop - } // out of while loop + } // out of while loop time_bench.time_search = watch.elapsed_ms();