Skip to content

Commit ead3e3b

Browse files
seanyenwjwwood
authored andcommitted
Use ros::Duration for sleep for cross-platform (#48)
Some systems (e.g. Windows) doesn't have POSIX sleep built-in in the runtime library. Use ros::Duration::sleep for better cross-compiling between platforms.
1 parent 2711263 commit ead3e3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

visualization_marker_tutorials/src/basic_shapes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int main( int argc, char** argv )
112112
return 0;
113113
}
114114
ROS_WARN_ONCE("Please create a subscriber to the marker");
115-
sleep(1);
115+
ros::Duration(1.0).sleep();
116116
}
117117
marker_pub.publish(marker);
118118
// %EndTag(PUBLISH)%

0 commit comments

Comments
 (0)