-
Notifications
You must be signed in to change notification settings - Fork 284
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
Cartesian twist controller #300
base: master
Are you sure you want to change the base?
Changes from 1 commit
1d5d4dc
9c6d2c1
b7187c9
4bf2cc5
8f31cf7
5bda0a8
c312b69
5c39225
87717e7
d99b3af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -43,7 +43,7 @@ TEST_F(TwistControllerTest, joint_names_parameter_not_set) | |||||
ASSERT_TRUE(controller_->joint_name_.empty()); | ||||||
ASSERT_TRUE(controller_->interface_names_.empty()); | ||||||
|
||||||
controller_->get_node()->set_parameter({"joint", joint_name_}); | ||||||
controller_->get_node()->set_parameter({"interface_names", interface_names_}); | ||||||
|
||||||
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), NODE_ERROR); | ||||||
|
||||||
|
@@ -55,7 +55,7 @@ TEST_F(TwistControllerTest, interface_parameter_not_set) | |||||
{ | ||||||
SetUpController(false); | ||||||
|
||||||
controller_->get_node()->set_parameter({"interface_names", interface_names_}); | ||||||
controller_->get_node()->set_parameter({"joint", joint_name_}); | ||||||
|
||||||
ASSERT_EQ(controller_->on_configure(rclcpp_lifecycle::State()), NODE_ERROR); | ||||||
|
||||||
|
@@ -138,6 +138,8 @@ TEST_F(TwistControllerTest, reactivate_success) | |||||
TEST_F(TwistControllerTest, command_callback_test) | ||||||
{ | ||||||
SetUpController(); | ||||||
rclcpp::executors::MultiThreadedExecutor executor; | ||||||
executor.add_node(controller_->get_node()->get_node_base_interface()); | ||||||
|
||||||
// default values | ||||||
ASSERT_EQ(command_itfs_.size(), 6u); | ||||||
|
@@ -149,20 +151,15 @@ TEST_F(TwistControllerTest, command_callback_test) | |||||
ASSERT_EQ(command_itfs_[4].get_value(), 0.0); | ||||||
ASSERT_EQ(command_itfs_[5].get_value(), 0.0); | ||||||
|
||||||
auto node_state = controller_->configure(); | ||||||
auto node_state = controller_->get_node()->configure(); | ||||||
ASSERT_EQ(node_state.id(), lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE); | ||||||
|
||||||
node_state = controller_->get_node()->activate(); | ||||||
ASSERT_EQ(node_state.id(), lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE); | ||||||
|
||||||
// send a new command | ||||||
// send a new command and wait | ||||||
publish_commands(); | ||||||
|
||||||
// wait for command message to be passed | ||||||
ASSERT_EQ(wait_for(controller_->twist_command_subscriber_), rclcpp::WaitResultKind::Ready); | ||||||
|
||||||
// process callbacks | ||||||
rclcpp::spin_some(controller_->get_node()->get_node_base_interface()); | ||||||
ASSERT_TRUE(controller_->wait_for_commands(executor)); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ros2_controllers/admittance_controller/test/test_admittance_controller.cpp Lines 268 to 269 in 6793e02
|
||||||
|
||||||
// update successful | ||||||
ASSERT_EQ( | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was called
joint_names_parameter_not_set
but was setting the joint param.The following test was called
interface_parameter_not_set
but was setting interface_name parameter.These two tests just check to it isn't possible to configure the controller with missing mandatory parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, could be that additional work was required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to swith to
generate_parameter_library
anyway and then those tests get partially obsolete.