Merge lp:~shadowrobot/sr-ros-interface/Feature_update_controller_params into lp:sr-ros-interface

Proposed by Toni Oliver
Status: Merged
Merged at revision: 392
Proposed branch: lp:~shadowrobot/sr-ros-interface/Feature_update_controller_params
Merge into: lp:sr-ros-interface
Diff against target: 97 lines (+44/-0)
5 files modified
sr_mechanism_controllers/src/srh_fake_joint_calibration_controller.cpp (+2/-0)
sr_mechanism_controllers/src/srh_joint_effort_controller.cpp (+4/-0)
sr_mechanism_controllers/src/srh_joint_position_controller.cpp (+9/-0)
sr_mechanism_controllers/src/srh_joint_velocity_controller.cpp (+10/-0)
sr_mechanism_controllers/src/srh_mixed_position_velocity_controller.cpp (+19/-0)
To merge this branch: bzr merge lp:~shadowrobot/sr-ros-interface/Feature_update_controller_params
Reviewer Review Type Date Requested Status
markpitchless Pending
Review via email: mp+133458@code.launchpad.net

Commit message

Update params in param server when changing controller parameters. Solved the waiting calib problem.

Description of the change

Update params in param server when changing controller parameters. Solved the waiting calib problem.

To post a comment you must log in.
Revision history for this message
markpitchless (markpitchless) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sr_mechanism_controllers/src/srh_fake_joint_calibration_controller.cpp'
2--- sr_mechanism_controllers/src/srh_fake_joint_calibration_controller.cpp 2012-08-20 07:44:40 +0000
3+++ sr_mechanism_controllers/src/srh_fake_joint_calibration_controller.cpp 2012-11-08 11:52:35 +0000
4@@ -118,6 +118,8 @@
5 initialize_pids();
6 joint_->calibrated_ = true;
7 state_ = CALIBRATED;
8+ //We add the following line to delay for some time the first publish and allow the correct initialization of the subscribers in calibrate.py
9+ last_publish_time_ = robot_->getTime();
10 break;
11 case CALIBRATED:
12 if (pub_calibrated_)
13
14=== modified file 'sr_mechanism_controllers/src/srh_joint_effort_controller.cpp'
15--- sr_mechanism_controllers/src/srh_joint_effort_controller.cpp 2012-10-31 06:48:22 +0000
16+++ sr_mechanism_controllers/src/srh_joint_effort_controller.cpp 2012-11-08 11:52:35 +0000
17@@ -140,6 +140,10 @@
18 max_force_demand = req.max_force;
19 friction_deadband = req.friction_deadband;
20
21+ //Setting the new parameters in the parameter server
22+ node_.setParam("max_force", max_force_demand);
23+ node_.setParam("friction_deadband", friction_deadband);
24+
25 return true;
26 }
27
28
29=== modified file 'sr_mechanism_controllers/src/srh_joint_position_controller.cpp'
30--- sr_mechanism_controllers/src/srh_joint_position_controller.cpp 2012-10-29 14:05:51 +0000
31+++ sr_mechanism_controllers/src/srh_joint_position_controller.cpp 2012-11-08 11:52:35 +0000
32@@ -165,6 +165,15 @@
33 friction_deadband = req.friction_deadband;
34 position_deadband = req.deadband;
35
36+ //Setting the new parameters in the parameter server
37+ node_.setParam("pid/p", req.p);
38+ node_.setParam("pid/i", req.i);
39+ node_.setParam("pid/d", req.d);
40+ node_.setParam("pid/i_clamp", req.i_clamp);
41+ node_.setParam("pid/max_force", max_force_demand);
42+ node_.setParam("pid/position_deadband", position_deadband);
43+ node_.setParam("pid/friction_deadband", friction_deadband);
44+
45 return true;
46 }
47
48
49=== modified file 'sr_mechanism_controllers/src/srh_joint_velocity_controller.cpp'
50--- sr_mechanism_controllers/src/srh_joint_velocity_controller.cpp 2012-11-02 12:26:26 +0000
51+++ sr_mechanism_controllers/src/srh_joint_velocity_controller.cpp 2012-11-08 11:52:35 +0000
52@@ -159,6 +159,16 @@
53 friction_deadband = req.friction_deadband;
54 velocity_deadband = req.deadband;
55
56+ //Setting the new parameters in the parameter server
57+ node_.setParam("pid/p", req.p);
58+ node_.setParam("pid/i", req.i);
59+ node_.setParam("pid/d", req.d);
60+ node_.setParam("pid/i_clamp", req.i_clamp);
61+
62+ node_.setParam("pid/max_force", max_force_demand);
63+ node_.setParam("pid/velocity_deadband", velocity_deadband);
64+ node_.setParam("pid/friction_deadband", friction_deadband);
65+
66 return true;
67 }
68
69
70=== modified file 'sr_mechanism_controllers/src/srh_mixed_position_velocity_controller.cpp'
71--- sr_mechanism_controllers/src/srh_mixed_position_velocity_controller.cpp 2012-10-29 14:05:51 +0000
72+++ sr_mechanism_controllers/src/srh_mixed_position_velocity_controller.cpp 2012-11-08 11:52:35 +0000
73@@ -196,6 +196,25 @@
74 min_velocity_ = req.min_velocity;
75 max_velocity_ = req.max_velocity;
76
77+ //Setting the new parameters in the parameter server
78+ node_.setParam("position_pid/p", req.position_p);
79+ node_.setParam("position_pid/i", req.position_i);
80+ node_.setParam("position_pid/d", req.position_d);
81+ node_.setParam("position_pid/i_clamp", req.position_i_clamp);
82+
83+ node_.setParam("velocity_pid/p", req.velocity_p);
84+ node_.setParam("velocity_pid/i", req.velocity_i);
85+ node_.setParam("velocity_pid/d", req.velocity_d);
86+ node_.setParam("velocity_pid/i_clamp", req.velocity_i_clamp);
87+
88+ node_.setParam("position_pid/min_velocity", min_velocity_);
89+ node_.setParam("position_pid/max_velocity", max_velocity_);
90+ node_.setParam("position_pid/position_deadband", position_deadband);
91+
92+ node_.setParam("velocity_pid/friction_deadband", friction_deadband);
93+ node_.setParam("velocity_pid/max_force", max_force_demand);
94+ node_.setParam("motor_min_force_threshold", motor_min_force_threshold);
95+
96 return true;
97 }
98

Subscribers

People subscribed via source and target branches

to all changes: