Skip to content

Commit 635fe06

Browse files
authored
ur_robot_driver: Fix compilation on Windows
1 parent 56dfa1e commit 635fe06

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

ur_robot_driver/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ option(
99
OFF
1010
)
1111

12-
add_compile_options(-Wall)
13-
add_compile_options(-Wextra)
14-
add_compile_options(-Wno-unused-parameter)
12+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
13+
add_compile_options(-Wall)
14+
add_compile_options(-Wextra)
15+
add_compile_options(-Wno-unused-parameter)
16+
endif()
17+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
1518

1619
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
1720
message("${PROJECT_NAME}: You did not request a specific build type: selecting 'RelWithDebInfo'.")

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ std::vector<hardware_interface::StateInterface> URPositionHardwareInterface::exp
181181
const std::vector<std::string> fts_names = {
182182
"force.x", "force.y", "force.z", "torque.x", "torque.y", "torque.z"
183183
};
184-
for (uint j = 0; j < 6; ++j) {
184+
for (uint32_t j = 0; j < 6; ++j) {
185185
state_interfaces.emplace_back(
186186
hardware_interface::StateInterface(sensor.name, fts_names[j], &urcl_ft_sensor_measurements_[j]));
187187
}

ur_robot_driver/src/robot_state_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ void RobotStateHelper::setModeExecute(const std::shared_ptr<RobotStateHelper::Se
366366
result_->message = "Play program service not available on this robot.";
367367
} else {
368368
// The dashboard denies playing immediately after switching the mode to RUNNING
369-
sleep(1);
369+
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
370370
result_->success = safeDashboardTrigger(this->play_program_srv_);
371371
}
372372
}

0 commit comments

Comments
 (0)