teaching:se-kiba:manipulation-assignment:executive
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
teaching:se-kiba:manipulation-assignment:executive [2013/04/24 16:49] – [Moving the Arms (a first glance)] bartelsg | teaching:se-kiba:manipulation-assignment:executive [2016/05/19 09:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 45: | Line 45: | ||
As a last step, update your launch-file for your users: | As a last step, update your launch-file for your users: | ||
- | * In your launch-file, | + | * In your launch-file, |
* If you now launch our environment, | * If you now launch our environment, | ||
- | Hints: You can peek [[http:// | + | Hints: You can peek [[http:// |
===== Moving the Arms (revisited) ===== | ===== Moving the Arms (revisited) ===== | ||
+ | Now that we have the code to make one arm move, let's try to make it more convenient and reusable: | ||
+ | * In our executive package, create a sub-directory config. | ||
+ | * Copy left_arm_goals.yaml and right_arm_goals.yaml from the materials directory to config | ||
+ | * In the launch-file, | ||
+ | * After starting your launch-file, | ||
- | [[http://www.ros.org/wiki/ROS/Tutorials/Roslaunch%20tips%20for%20larger%20projects|roslaunch tips]] | + | $ rosparam list | grep goal |
+ | < | ||
+ | | ||
+ | | ||
+ | / | ||
+ | / | ||
+ | < | ||
+ | $ rosparam get / | ||
+ | [l_shoulder_pan_joint, | ||
- | [[http:// | + | Your next assignment is to load and use these parameters from the parameter server. We will do this in a new library package. This package will not contain any executable but just library code to be used by other packages. |
- | ===== Exposing a Library | + | * Create a new package called iai_seminar_manipulation_utils. Add a dependency on roscpp |
+ | * Copy ParameterServerUtils.h from the materials to include directory of that package. | ||
+ | * Create the equivalent cpp-file in src, and add it to the build requirements of the utils package in the CMakeLists __as a library__. The following [[http:// | ||
+ | |||
+ | NOTE: ROS libraries are a great thing that basically offer two advantages. (1) They help __you__ re-use code in various of your ROS application. (2) If you provide some generic algorithm as library as a pure c/c++ library, you even allow __non-ROS-users__ to use your algorithm in their work. This is hard to achieve but the ultimate design goal: A clean cut between functionality/ | ||
+ | |||
+ | * Now, implement all functionality described in ParameterServerUtils.h to load values from the parameter server. Consider using the data already one the server to test your functions. ([[http:// | ||
+ | * Afterwards, let the executive package depend on the library package. Use the parameter-server-functions (and our original initGoal and startTrajectory) in the executive package to implement the second version of initGoal and startTrajectory of the RobotArm class -- it should be quick! | ||
+ | * Now, use the new initGoal(ros:: | ||
+ | |||
+ | Using parameters from the server instead of hard-coded values the way we just did has several tremendous advantages: | ||
+ | * It shows users which kind of parameters your node needs to produce useful results. | ||
+ | * It also provides them with a set of _specific_ example parameters that should work (always nice for demonstrations) | ||
+ | * It allows you to change your current choice of parameters without recompiling the node. This will save you a lot of time in the future. | ||
+ | |||
+ | ===== Moving the Arms (re-using code) ===== | ||
+ | Finally, we will re-use our code to move both arms: | ||
+ | * In the launch-file, | ||
+ | * In the launch-file, | ||
+ | |||
+ | That's it. We have just completely re-used our code to control another arm! Imagine how much time you could save on a spider... ;) |
teaching/se-kiba/manipulation-assignment/executive.1366822168.txt.gz · Last modified: 2016/05/19 09:18 (external edit)