diff --git a/turtlesim/tutorials/draw_square.cpp b/turtlesim/tutorials/draw_square.cpp index dbb8adcd..8a3400c9 100644 --- a/turtlesim/tutorials/draw_square.cpp +++ b/turtlesim/tutorials/draw_square.cpp @@ -119,7 +119,7 @@ void turn(rclcpp::Publisher::SharedPtr twist_pub) void timerCallback(rclcpp::Publisher::SharedPtr twist_pub) { - if (g_first_pose_set) + if (!g_first_pose_set) // Fixed the issue where only a straight line was drawn instead of a square. { return; }