How to manage extrinsic sensor calibration dynamically with urdf?
Is there a standard way of doing this in ROS? The idea is to have a base URDF created from CAD data that can be supplemented by an extrinsic calibration file that contains the pose deltas (offsets from CAD model) for different sensors after calibrating them. Those offsets then could be applied to the URDF before loading the robot description.
I was thinking about implementing something like that but wanted to check if it already exists.
Does it have to be URDF? Or would
.xacro
also be acceptable?Xacro has support for loading
.yaml
files, which would make "updating" a template rather trivial.ubi-agni/human_hand is a rather complex -- but very nice -- example of this.
It's also used by UniversalRobots/Universal_Robots_ROS_Driver to load the factory-provided calibration data.
Yes I was thinking about xacro/urdf actually I will check it out thanks! Feel free to post it as an answer
My comment was really more of a hint I believe.
If you figure out how to do this in your specific application (based on what I wrote), I'd really appreciate you posting an answer yourself showing a concrete (ie: stand-alone) example.
That would be infinitely more valuable than two links to some Github repositories.
Hmm, haven't known about
load_yaml()
support in Xacro. That looks definitely interesting and like one of the good ways to tackle this.We use a custom piece of code that can load the calibration either from ROS params or YAML files. With YAML files, we support "hierarchy" of them, so you have e.g. some configs common to all robots of a given type and then you have specific configs for each robot. This logic is performed by a Python script, which at the end calls this snippet to render the URDF. Note that this snippet expects that each key from
(more)config
has a corresponding<xacro:arg>
in the XACRO file.The reason to support rendering of the robot model from ROS params is that is allows easy online calibration. When connected with https://github.com/peci1/dynamic_robo..., you can notify the state publisher that the URDF has changed and it automatically re-computes and re-publishes all of the static transforms that correspond to the updated calibration.