[ros-users] Request for comments: OctoMap ROS interface

Stéphane Magnenat stephane.magnenat at mavt.ethz.ch
Tue Feb 22 09:10:18 UTC 2011

Hi Armin,

> On 2011-02-10 09:42, Stéphane Magnenat wrote:
>> - constructor with double: Add const to double. In general, it is good
>> to add const to scalar arguments (also appears in insertScan()).
> Is there an immediate benefit to that? I'm aware of avoiding copies of
> large objects by passing them as const references, but I can't think of
> a reason to 'const' every scalar value... would that also apply to any
> bool, then?

I agree that most probably the compiler would figure itself that the 
value of the variable will not change, but IMHO it is good practice to 
constrain the types as much as possible, as it limits the runtime error 
space. Anyway, this was a minor comment ;-)

>> - for castRay()/insertRay(), it would be nice to templatize them on a
>> functor performing per-cell operation (of course, this implies adding
>> this feature to the underlying octomap implementation). This would allow
>> to decouple the map book-keeping operations from the functional ones.
>> Probably in the case of an octree it is not trivial as one must allocate
>> cells if the functor changes the map, but it is certainly generic and
>> useful.
> That would be indeed nice to have as a clean solution, but as it
> requires some rewriting of OctoMap itself it probably won't happen soon.

I agree, we can keep this in mind for an OctoMap2 ;-)

Have a nice day,


Dr Stéphane Magnenat

More information about the ros-users mailing list