Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# Detect ROS distro for API compatibility
if(DEFINED ENV{ROS_DISTRO})
if("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
add_compile_definitions(ROS_DISTRO_JAZZY)
elseif("$ENV{ROS_DISTRO}" STREQUAL "humble")
add_compile_definitions(ROS_DISTRO_HUMBLE)
endif()
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(controller_interface REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn Roboti
bool RobotiqActivationController::reactivateGripper(std_srvs::srv::Trigger::Request::SharedPtr /*req*/,
std_srvs::srv::Trigger::Response::SharedPtr resp)
{
#ifdef ROS_DISTRO_JAZZY
std::ignore = command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].set_value(ASYNC_WAITING);
std::ignore = command_interfaces_[REACTIVATE_GRIPPER_CMD].set_value(1.0);

Expand All @@ -116,16 +115,6 @@ bool RobotiqActivationController::reactivateGripper(std_srvs::srv::Trigger::Requ
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
resp->success = command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_optional<double>().value();
#else
command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].set_value(ASYNC_WAITING);
command_interfaces_[REACTIVATE_GRIPPER_CMD].set_value(1.0);

while (command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_value() == ASYNC_WAITING)
{
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
resp->success = command_interfaces_[REACTIVATE_GRIPPER_RESPONSE].get_value();
#endif

return resp->success;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See https://docs.ros.org/en/humble/How-To-Guides/Ament-CMake-Documentation.html
# See https://docs.ros.org/en/jazzy/How-To-Guides/Ament-CMake-Documentation.html

cmake_minimum_required(VERSION 3.8)
project(robotiq_driver LANGUAGES CXX)
Expand All @@ -10,15 +10,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# Detect ROS distro for API compatibility
if(DEFINED ENV{ROS_DISTRO})
if("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
add_compile_definitions(ROS_DISTRO_JAZZY)
elseif("$ENV{ROS_DISTRO}" STREQUAL "humble")
add_compile_definitions(ROS_DISTRO_HUMBLE)
endif()
endif()

find_package(ament_cmake REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(pluginlib REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,8 @@ class RobotiqGripperHardwareInterface : public hardware_interface::SystemInterfa
* @returns CallbackReturn::SUCCESS if required data are provided and can be
* parsed or CallbackReturn::ERROR if any error happens or data are missing.
*/
#ifdef ROS_DISTRO_JAZZY
ROBOTIQ_DRIVER_PUBLIC
CallbackReturn on_init(const hardware_interface::HardwareComponentInterfaceParams& params) override;
#else
ROBOTIQ_DRIVER_PUBLIC
CallbackReturn on_init(const hardware_interface::HardwareInfo& info) override;
#endif

/**
* Connect to the hardware.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ RobotiqGripperHardwareInterface::RobotiqGripperHardwareInterface(std::unique_ptr
{
}

#ifdef ROS_DISTRO_JAZZY
hardware_interface::CallbackReturn RobotiqGripperHardwareInterface::on_init(const hardware_interface::HardwareComponentInterfaceParams& params)
{
RCLCPP_DEBUG(kLogger, "on_init");
Expand All @@ -81,17 +80,6 @@ hardware_interface::CallbackReturn RobotiqGripperHardwareInterface::on_init(cons
{
return CallbackReturn::ERROR;
}
#else
hardware_interface::CallbackReturn RobotiqGripperHardwareInterface::on_init(const hardware_interface::HardwareInfo& info)
{
RCLCPP_DEBUG(kLogger, "on_init");

if (hardware_interface::SystemInterface::on_init(info) != CallbackReturn::SUCCESS)
{
return CallbackReturn::ERROR;
}
#endif

// Read parameters.
gripper_closed_pos_ = stod(info_.hardware_parameters["gripper_closed_position"]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TEST(TestRobotiqGripperHardwareInterface, load_urdf)
<param name="COM_port">/dev/ttyUSB0</param>
<param name="gripper_closed_position">0.7929</param>
</hardware>
<joint name="robotiq_85_left_knuckle_joint">
<joint name="joint1">
<command_interface name="position" />
<state_interface name="position">
<param name="initial_value">0.7929</param>
Expand All @@ -76,12 +76,8 @@ TEST(TestRobotiqGripperHardwareInterface, load_urdf)
)";

auto urdf = ros2_control_test_assets::urdf_head + urdf_control_ + ros2_control_test_assets::urdf_tail;
#ifdef ROS_DISTRO_JAZZY
hardware_interface::ResourceManager rm(urdf, std::make_shared<rclcpp::Clock>(RCL_ROS_TIME),
rclcpp::get_logger("test_robotiq_gripper_hardware_interface"));
#else
hardware_interface::ResourceManager rm(urdf);
#endif

// Check interfaces
EXPECT_EQ(1u, rm.system_components_size());
Expand Down
8 changes: 0 additions & 8 deletions src/hangar_sim/config/control/picknik_ur.ros2_control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,6 @@ joint_trajectory_controller:
rotational_yaw_joint:
p: 2.0
ff_velocity_scale: 1.0
# The base yaw is a continuous joint that accumulates past +/-pi over a run. Without wraparound the
# velocity controller drives error = command - state literally, so a goal expressed as a 2*pi-shifted
# equivalent of the current heading makes the base spin a full turn the long way (the "pirouette" of
# moveit_pro#19973). Wrapping the error to the shortest path keeps it on the short arc for any goal
# representation. This mitigates the upstream trajectory-representation splice tracked in that issue
# but is the correct configuration for a continuous joint regardless. Humble-specific: Jazzy's
# joint_trajectory_controller detects continuous joints from the URDF and wraps automatically.
angle_wraparound: true
constraints:
stopped_velocity_tolerance: 0.0
goal_time: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Action
ID="NavigateToPoseAction"
action_name="/navigate_to_pose"
behavior_tree_path="/opt/ros/humble/share/nav2_bt_navigator/behavior_trees/navigate_to_pose_w_replanning_and_recovery.xml"
behavior_tree_path="/opt/ros/jazzy/share/nav2_bt_navigator/behavior_trees/navigate_to_pose_w_replanning_and_recovery.xml"
ignore_stamp_time="true"
pose_stamped="{goal}"
/>
Expand Down
3 changes: 1 addition & 2 deletions src/hangar_sim/test/objectives_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@
# reasons.
"Teleoperate", # DoTeleoperateAction rejects the goal with no UI subscribed.
"Marker Visualization Example", # GetTextFromUser server unavailable headless.
# Jazzy CI-runner flakes (pass on the slower humble runner, intermittent on
# jazzy). Skipped so the suite is deterministic on both distros.
# Intermittent Jazzy CI-runner flakes. Skipped so the suite is deterministic.
#
# "Solution - Draw Picknik" is the suite's longest objective and sits on
# the 90 s execute-timeout boundary on the jazzy runner. When it overruns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wpedantic)
endif()

# Detect ROS distro for API compatibility
if(DEFINED ENV{ROS_DISTRO})
if("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
add_compile_definitions(ROS_DISTRO_JAZZY)
elseif("$ENV{ROS_DISTRO}" STREQUAL "humble")
add_compile_definitions(ROS_DISTRO_HUMBLE)
endif()
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_ros REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ void ProtectiveStopManager::recoverFromProtectiveStop(const std_srvs::srv::Trigg
return;
}
auto deactivate_all_controllers_request = std::make_shared<SwitchController::Request>();
#ifdef ROS_DISTRO_JAZZY
deactivate_all_controllers_request->deactivate_controllers = all_controller_names;
#else
deactivate_all_controllers_request->stop_controllers = all_controller_names;
#endif
// Use BEST_EFFORT strictness because some controllers may already be inactive, and attempting to stop them while
// using STRICT strictness would introduce an unnecessary error.
deactivate_all_controllers_request->strictness = SwitchController::Request::BEST_EFFORT;
Expand Down Expand Up @@ -113,11 +109,7 @@ void ProtectiveStopManager::recoverFromProtectiveStop(const std_srvs::srv::Trigg
// This resets the state of the robot controllers to match the state it was in at startup.
RCLCPP_INFO_STREAM(kLogger, "Reactivating default controllers...");
auto activate_default_controllers_request = std::make_shared<SwitchController::Request>();
#ifdef ROS_DISTRO_JAZZY
activate_default_controllers_request->activate_controllers = active_controller_names;
#else
activate_default_controllers_request->start_controllers = active_controller_names;
#endif
// BEST_EFFORT is good enough to put the system back into an operational state without throwing unnecessary errors.
activate_default_controllers_request->strictness = SwitchController::Request::BEST_EFFORT;
auto activate_default_controllers_future =
Expand Down
Loading