Skip to content

Commit

Permalink
sync examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Dec 20, 2023
1 parent f7942a5 commit bde1a21
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ target_include_directories(ruckig PUBLIC
)
target_link_libraries(ruckig PUBLIC)


if(MSVC)
target_compile_definitions(ruckig PUBLIC _USE_MATH_DEFINES)
endif()
Expand Down
2 changes: 1 addition & 1 deletion examples/04_waypoints_online.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main() {
input.interrupt_calculation_duration = 500; // [µs]

std::cout << "t | position" << std::endl;
double calculation_duration {0.0};
double calculation_duration = 0.0;
while (otg.update(input, output) == Result::Working) {
if (output.new_calculation) {
std::cout << "Updated the trajectory:" << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion examples/08_per_section_minimum_duration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main() {
input.per_section_minimum_duration = {0, 2.0, 0.0, 1.0, 0.0, 2.0, 0};

std::cout << "t | position" << std::endl;
double calculation_duration {0.0};
double calculation_duration = 0.0;
while (otg.update(input, output) == Result::Working) {
std::cout << output.time << " | " << join(output.new_position) << std::endl;

Expand Down
6 changes: 3 additions & 3 deletions examples/14_tracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ int main() {
// Generate the trajectory within the control loop
std::cout << "target | follow" << std::endl;
for (size_t t = 0; t < 500; t += 1) {
auto target_state = model_ramp(otg.delta_time * t);
auto res = otg.update(target_state, input, output);
std::cout << target_state.position[0] << " " << output.new_position[0] << std::endl;
const TargetState<1> target_state = model_ramp(otg.delta_time * t);
const Result res = otg.update(target_state, input, output);
std::cout << join(target_state.position) << " " << join(output.new_position) << std::endl;

output.pass_to_input(input);
}
Expand Down

0 comments on commit bde1a21

Please sign in to comment.