Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate diff drive controller to resourcemanager #128

Conversation

bmagyar
Copy link
Member

@bmagyar bmagyar commented Dec 16, 2020

No description provided.

@bmagyar bmagyar force-pushed the migrate_diff_drive_controller_to_resourcemanager branch 2 times, most recently from 6755802 to 1c8259d Compare December 16, 2020 12:08
@codecov-io
Copy link

codecov-io commented Dec 16, 2020

Codecov Report

Merging #128 (5d5b571) into master (b0e3d19) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #128      +/-   ##
==========================================
  Coverage   37.16%   37.16%              
==========================================
  Files         135       15     -120     
  Lines       16758     1862   -14896     
  Branches    10557     1173    -9384     
==========================================
- Hits         6228      692    -5536     
+ Misses       1098      122     -976     
+ Partials     9432     1048    -8384     
Flag Coverage Δ
unittests 37.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...te_controller/test/test_joint_state_controller.cpp
...nt_state_controller/src/joint_state_controller.cpp
...te_controller/test/test_joint_state_controller.cpp
...ers/joint_trajectory_controller/src/trajectory.cpp
...te_controller/test/test_joint_state_controller.cpp
...ler/test/test_load_joint_trajectory_controller.cpp
...include/joint_trajectory_controller/trajectory.hpp
...ectory_controller/test/test_trajectory_actions.cpp
...ers/joint_trajectory_controller/src/trajectory.cpp
...mand_controller/src/forward_command_controller.cpp
... and 140 more

@bmagyar bmagyar force-pushed the migrate_diff_drive_controller_to_resourcemanager branch from 1c8259d to d46c90e Compare December 16, 2020 12:22
@bmagyar bmagyar requested a review from destogl December 16, 2020 12:22
@bmagyar bmagyar changed the title WIP Migrate diff drive controller to resourcemanager Migrate diff drive controller to resourcemanager Dec 16, 2020
@bmagyar bmagyar force-pushed the migrate_diff_drive_controller_to_resourcemanager branch from 7ba0bea to 19b1346 Compare December 19, 2020 19:43
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some commented lines in the tests....

right_wheel_names_(std::move(right_wheel_names)),
write_op_names_(std::move(write_op_names))
{}

controller_interface::return_type
DiffDriveController::init(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better?

Suggested change
DiffDriveController::init(
DiffDriveController::init(const std::string & controller_name)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

controller_interface::return_type
DiffDriveController::init(
std::weak_ptr<hardware_interface::RobotHardware> robot_hardware,
const std::string & controller_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if above...

Suggested change
const std::string & controller_name)


is_halted = false;
subscriber_is_active_ = true;

RCLCPP_INFO(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RCLCPP_INFO(
RCLCPP_DEBUG(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, changed

setup_controller(*diff_drive_controller, executor);
executor.add_node(controller_->get_node()->get_node_base_interface());
auto state = controller_->configure();
// ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());
ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now


state = controller_->activate();
// ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());
ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now

state = diff_drive_lifecycle_node->cleanup();
ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());
state = controller_->cleanup();
// ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());
ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now

state = diff_drive_lifecycle_node->activate();
ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());
state = controller_->activate();
// ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());
ASSERT_EQ(State::PRIMARY_STATE_ACTIVE, state.id());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now

diff_drive_controller->update();
test_robot->write();
state = controller_->deactivate();
// ASSERT_EQ(state.id(), State::PRIMARY_STATE_INACTIVE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(state.id(), State::PRIMARY_STATE_INACTIVE);
ASSERT_EQ(state.id(), State::PRIMARY_STATE_INACTIVE);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now

state = diff_drive_lifecycle_node->configure();
ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());
state = controller_->cleanup();
// ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());
ASSERT_EQ(State::PRIMARY_STATE_UNCONFIGURED, state.id());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now

EXPECT_EQ(0.0, right_wheel_vel_cmd_.get_value());

state = controller_->configure();
// ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());
ASSERT_EQ(State::PRIMARY_STATE_INACTIVE, state.id());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, restored now

@bmagyar bmagyar force-pushed the migrate_diff_drive_controller_to_resourcemanager branch from b003332 to 4c0fd8f Compare December 29, 2020 07:19
@bmagyar
Copy link
Member Author

bmagyar commented Dec 29, 2020

Thanks @destogl , I think I've addressed all your points

@destogl destogl mentioned this pull request Jan 1, 2021
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good.

@bmagyar bmagyar merged commit 25bdfc5 into ros-controls:master Jan 2, 2021
gwalck pushed a commit to StoglRobotics-forks/ros2_controllers that referenced this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants