Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Najjar committed Nov 9, 2023
1 parent 49e8da8 commit 256bd84
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/iron-binary-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- iron
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '03 2 * * *'
- cron: '03 1 * * *'

jobs:
binary:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iron-binary-build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- iron
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '03 2 * * *'
- cron: '03 1 * * *'

jobs:
binary:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iron-rhel-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- iron
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '03 2 * * *'
- cron: '03 1 * * *'


jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iron-semi-binary-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- iron
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '33 2 * * *'
- cron: '33 1 * * *'

jobs:
semi_binary:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iron-semi-binary-build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- iron
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '33 2 * * *'
- cron: '33 1 * * *'

jobs:
semi_binary:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iron-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- iron
schedule:
# Run every day to detect flakiness and broken dependencies
- cron: '03 4 * * *'
- cron: '03 3 * * *'

jobs:
source:
Expand Down
1 change: 0 additions & 1 deletion joint_trajectory_controller/doc/userdoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ Services

Further information
--------------------------------------------------------------
(TBD in ...)

.. toctree::
:titlesonly:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
using ControllerStateMsg = control_msgs::msg::JointTrajectoryControllerState;
using StatePublisher = realtime_tools::RealtimePublisher<ControllerStateMsg>;
using StatePublisherPtr = std::unique_ptr<StatePublisher>;
rclcpp::Publisher<ControllerStateMsg>::SharedPtr publisher_legacy_;
StatePublisherPtr state_publisher_legacy_;
rclcpp::Publisher<ControllerStateMsg>::SharedPtr publisher_;
StatePublisherPtr state_publisher_;

Expand Down Expand Up @@ -285,4 +283,4 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa

} // namespace joint_trajectory_controller

#endif // JOINT_TRAJECTORY_CONTROLLER__JOINT_TRAJECTORY_CONTROLLER_HPP_
#endif // JOINT_TRAJECTORY_CONTROLLER__JOINT_TRAJECTORY_CONTROLLER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -1574,4 +1574,4 @@ void JointTrajectoryController::init_hold_position_msg()
#include "pluginlib/class_list_macros.hpp"

PLUGINLIB_EXPORT_CLASS(
joint_trajectory_controller::JointTrajectoryController, controller_interface::ControllerInterface)
joint_trajectory_controller::JointTrajectoryController, controller_interface::ControllerInterface)
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ TEST_P(TrajectoryControllerTestParameterized, correct_initialization_using_param
executor.cancel();
}

TEST_P(TrajectoryControllerTestParameterized, state_topic_legacy_consistency)
TEST_P(TrajectoryControllerTestParameterized, state_topic_consistency)
{
rclcpp::executors::SingleThreadedExecutor executor;
SetUpAndActivateTrajectoryController(executor, {});
Expand All @@ -326,7 +326,7 @@ TEST_P(TrajectoryControllerTestParameterized, state_topic_legacy_consistency)

// Spin to receive latest state
executor.spin_some();
auto state = getStateLegacy();
auto state = getState();

size_t n_joints = joint_names_.size();

Expand Down Expand Up @@ -1959,4 +1959,4 @@ INSTANTIATE_TEST_SUITE_P(
// set_parameter_and_check_result();
// state_interface_types_ = {"velocity"};
// set_parameter_and_check_result();
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ class TestableJointTrajectoryController

double get_cmd_timeout() { return cmd_timeout_; }

bool use_closed_loop_pid_adapter() { return use_closed_loop_pid_adapter_; }

bool is_open_loop() { return params_.open_loop_control; }

rclcpp::WaitSet joint_cmd_sub_wait_set_;
};

Expand Down Expand Up @@ -299,28 +295,6 @@ class TrajectoryControllerTest : public ::testing::Test

static void TearDownTestCase() { rclcpp::shutdown(); }

void subscribeToStateLegacy()
{
auto traj_lifecycle_node = traj_controller_->get_node();
traj_lifecycle_node->set_parameter(
rclcpp::Parameter("state_publish_rate", static_cast<double>(100)));

using control_msgs::msg::JointTrajectoryControllerState;

auto qos = rclcpp::SensorDataQoS();
// Needed, otherwise spin_some() returns only the oldest message in the queue
// I do not understand why spin_some provides only one message
qos.keep_last(1);
state_legacy_subscriber_ =
traj_lifecycle_node->create_subscription<JointTrajectoryControllerState>(
controller_name_ + "/state", qos,
[&](std::shared_ptr<JointTrajectoryControllerState> msg)
{
std::lock_guard<std::mutex> guard(state_legacy_mutex_);
state_legacy_msg_ = msg;
});
}

void subscribeToState()
{
auto traj_lifecycle_node = traj_controller_->get_node();
Expand Down Expand Up @@ -462,11 +436,6 @@ class TrajectoryControllerTest : public ::testing::Test
}
}

std::shared_ptr<control_msgs::msg::JointTrajectoryControllerState> getStateLegacy() const
{
std::lock_guard<std::mutex> guard(state_legacy_mutex_);
return state_legacy_msg_;
}
std::shared_ptr<control_msgs::msg::JointTrajectoryControllerState> getState() const
{
std::lock_guard<std::mutex> guard(state_mutex_);
Expand Down Expand Up @@ -590,10 +559,6 @@ class TrajectoryControllerTest : public ::testing::Test
state_subscriber_;
mutable std::mutex state_mutex_;
std::shared_ptr<control_msgs::msg::JointTrajectoryControllerState> state_msg_;
rclcpp::Subscription<control_msgs::msg::JointTrajectoryControllerState>::SharedPtr
state_legacy_subscriber_;
mutable std::mutex state_legacy_mutex_;
std::shared_ptr<control_msgs::msg::JointTrajectoryControllerState> state_legacy_msg_;

std::vector<double> joint_pos_;
std::vector<double> joint_vel_;
Expand Down Expand Up @@ -630,4 +595,4 @@ class TrajectoryControllerTestParameterized

} // namespace test_trajectory_controllers

#endif // TEST_TRAJECTORY_CONTROLLER_UTILS_HPP_
#endif // TEST_TRAJECTORY_CONTROLLER_UTILS_HPP_

0 comments on commit 256bd84

Please sign in to comment.