Skip to content

Commit b92e2eb

Browse files
traversaromergify[bot]
authored andcommitted
ur_robot_driver: Fix compilation on Windows (#1421)
(cherry picked from commit 94e574f)
1 parent d8298d2 commit b92e2eb

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
@@ -301,7 +301,7 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
301301
double pausing_ramp_up_increment_;
302302

303303
// resources switching aux vars
304-
std::vector<std::vector<uint>> stop_modes_;
304+
std::vector<std::vector<uint32_t>> stop_modes_;
305305
std::vector<std::vector<std::string>> start_modes_;
306306
bool position_controller_running_;
307307
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
@@ -220,7 +220,7 @@ std::vector<hardware_interface::StateInterface> URPositionHardwareInterface::exp
220220
const std::vector<std::string> fts_names = {
221221
"force.x", "force.y", "force.z", "torque.x", "torque.y", "torque.z"
222222
};
223-
for (uint j = 0; j < 6; ++j) {
223+
for (uint32_t j = 0; j < 6; ++j) {
224224
state_interfaces.emplace_back(
225225
hardware_interface::StateInterface(sensor.name, fts_names[j], &urcl_ft_sensor_measurements_[j]));
226226
}
@@ -1112,7 +1112,7 @@ hardware_interface::return_type URPositionHardwareInterface::prepare_command_mod
11121112
hardware_interface::return_type ret_val = hardware_interface::return_type::OK;
11131113

11141114
start_modes_ = std::vector<std::vector<std::string>>(info_.joints.size());
1115-
stop_modes_ = std::vector<std::vector<uint>>(info_.joints.size());
1115+
stop_modes_ = std::vector<std::vector<uint32_t>>(info_.joints.size());
11161116
std::vector<std::vector<std::string>> control_modes(info_.joints.size());
11171117
const std::string tf_prefix = info_.hardware_parameters.at("tf_prefix");
11181118

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)