-
Notifications
You must be signed in to change notification settings - Fork 182
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
Pose controller dynamic reconfig [WIP] #120
base: devel
Are you sure you want to change the base?
Conversation
@stonier I need access to yocs_msgs :/ |
@AlexReimann Can you check this pull request? daniel asked me to ask you to merge this one. |
9aa4613
to
583826a
Compare
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.
Just small stuffs, before merging
|
||
reconfig_server_ = boost::shared_ptr<dynamic_reconfigure::Server<yocs_msgs::PoseControllerConfig> >( | ||
new dynamic_reconfigure::Server<yocs_msgs::PoseControllerConfig>(nh_)); | ||
reconfig_callback_func_ = boost::bind(&DiffDrivePoseControllerROS::reconfigCB, this, _1, _2); |
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.
Instead of member variable, use a local variable.
///dynamic reconfigure server callback type | ||
dynamic_reconfigure::Server<yocs_msgs::PoseControllerConfig>::CallbackType reconfig_callback_func_; | ||
|
||
yocs_msgs::PoseControllerConfig test_; |
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.
Outdated, remove
@@ -248,4 +254,22 @@ void DiffDrivePoseControllerROS::disableCB(const std_msgs::EmptyConstPtr msg) | |||
} | |||
} | |||
|
|||
void DiffDrivePoseControllerROS::reconfigCB(yocs_msgs::PoseControllerConfig &config, uint32_t level) | |||
{ | |||
dynamic_reconfig_mutex_.lock(); |
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 is the wrong mutex, you have to lock with the same mutex as where you use the variables :/
Deadlocks because calling lock here and then calling controlPose here which tries to lock again. 3 possible ways to do this without c++11:
+1 with c++11:
|
a4b8a81
to
89fdcdd
Compare
@AlexReimann Already fixed the mutex logic. removed the lock from the controlPose() and controlOrientation() functions. |
mutex guards enabled, and tested.
89fdcdd
to
68be41f
Compare
You missed some locking (see additional commit). Also this foobars the parameter loaded from the params file. The dynamic reconfigure server is instantiated after the params are loaded from the files. So it will overwrite them (when it gets instantiated it triggers a reconfigure callback with the default values of the Config file). The way to do this properly is to have the param file parameter names the same as the dyn reconfigure Config file parameters. This way the dynamic reconfigure server will overwrite its defaults with the once from the ros parameter server (which has the values from the params file). |
Seems like they already have the same name, going to do some more digging. It definitely foobars something. |
68be41f
to
10cfae9
Compare
10cfae9
to
eb9ab14
Compare
There was a bug about w_min not being assigned properly. Checkout the commit. |
Added dynamic reconfigure to pose controller, this pull request depends on yocs_msgs pull request.
Test Procedure: