Skip to content

Commit 6e55493

Browse files
committed
ur_robot_driver: Fix compilation on Windows
1 parent 56dfa1e commit 6e55493

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
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/include/ur_robot_driver/hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
299299
double pausing_ramp_up_increment_;
300300

301301
// resources switching aux vars
302-
std::vector<std::vector<uint>> stop_modes_;
302+
std::vector<std::vector<uint32_t>> stop_modes_;
303303
std::vector<std::vector<std::string>> start_modes_;
304304
bool position_controller_running_;
305305
bool velocity_controller_running_;

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 2 additions & 2 deletions
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
}
@@ -1073,7 +1073,7 @@ hardware_interface::return_type URPositionHardwareInterface::prepare_command_mod
10731073
hardware_interface::return_type ret_val = hardware_interface::return_type::OK;
10741074

10751075
start_modes_ = std::vector<std::vector<std::string>>(info_.joints.size());
1076-
stop_modes_ = std::vector<std::vector<uint>>(info_.joints.size());
1076+
stop_modes_ = std::vector<std::vector<uint32_t>>(info_.joints.size());
10771077
std::vector<std::vector<std::string>> control_modes(info_.joints.size());
10781078
const std::string tf_prefix = info_.hardware_parameters.at("tf_prefix");
10791079

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)