Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:intermediate:costmaps [2022/04/27 13:50] – [Using other (pre-defined) cost-functions] schimpf | tutorials:intermediate:costmaps [2022/04/27 14:02] (current) – [Creating your own cost function] schimpf | ||
---|---|---|---|
Line 16: | Line 16: | ||
===== Setup ===== | ===== Setup ===== | ||
+ | *set up the environment in our terminal by calling the launch file: | ||
- | * launch the map-server in a terminal with < | + | |
- | | + | |
+ | |||
+ | *start a node in REPL with (roslisp-utilities: | ||
- | * start a node in REPL with (roslisp-utilities: | ||
* define costmap parameters: | * define costmap parameters: | ||
Line 27: | Line 29: | ||
<code lisp> | <code lisp> | ||
(prolog: | (prolog: | ||
- | (prolog:< | + | (prolog:< |
- | (prolog:< | + | (prolog:< |
- | (prolog:< | + | (prolog:< |
- | (prolog:< | + | (prolog:< |
</ | </ | ||
Line 101: | Line 103: | ||
(if (and (< (cl-transforms: | (if (and (< (cl-transforms: | ||
(> (abs (/ (cl-transforms: | (> (abs (/ (cl-transforms: | ||
- | (abs (/ (cl-transforms: | + | 1 |
- | 0.0d0))))) | + | |
- | </ | + | </ |
+ | To summerize, we can see that the individual value in the costmap generator is set to 1 if it is behind the reference point and else it's set to 0. | ||
* define order for your costmap function and give it a name: | * define order for your costmap function and give it a name: | ||
Line 143: | Line 146: | ||
(car (prolog: | (car (prolog: | ||
</ | </ | ||
+ | The code can also be used to visualize the other costmap functions in this tutorial. | ||
{{: | {{: | ||
Line 181: | Line 185: | ||
The visualized costmap looks like this: | The visualized costmap looks like this: | ||
- | <code lisp> | ||
- | (location-costmap: | ||
- | | ||
- | '?cm | ||
- | (car (prolog: | ||
- | </ | ||
{{: | {{: | ||
* using range costmap function inverted: | * using range costmap function inverted: | ||
Line 202: | Line 200: | ||
The visualized costmap looks like this: | The visualized costmap looks like this: | ||
- | <code lisp> | ||
- | (location-costmap: | ||
- | | ||
- | '?cm | ||
- | (car (prolog: | ||
- | </ | ||
{{: | {{: | ||
===== Using your own Z coordinate function ===== | ===== Using your own Z coordinate function ===== | ||
Line 234: | Line 226: | ||
</ | </ | ||
The end result is that all the poses generated will now have a z-coordinate of 1.0 units. | The end result is that all the poses generated will now have a z-coordinate of 1.0 units. | ||
+ | |||
+ | The visualized costmap using the bullet world looks like this: | ||
{{: | {{: | ||
Line 296: | Line 290: | ||
</ | </ | ||
+ | The visualized costmap using the bullet world looks like this: | ||
+ | |||
{{: | {{: |