A ROS Node in the spirit of tf's static_transform_publisher but with a service to set the transform while running and the ability to persist changes if desired.
- ROS
- YAML-CPP
- Create a yaml file with the following syntax:
- parent: foo
child: bar
x: 0
y: 1
z: 2
qx: 0
qz: 0
qy: 0
qw: 1
- parent: foo
child: baz
x: 0
y: 0
z: 0
qx: 0
qy: 0
qz: 0
qw: 1
- Run the
mutable_transform_pub
node inmutable_transform_publisher
and set theyaml_path
argument.
rosrun mutable_transform_publisher mutable_transform_pub _yaml_path:=<PATH_TO_YOUR_YAML>
- While running, you can call the
set_transform
service of typemutable_transform_publisher::SetTranform
.
rosservice call /set_transform "transform:
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: 'foo'
child_frame_id: 'bar'
transform:
translation:
x: 0.0
y: 0.0
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0"
-
You can also use the
set_transform
service to add a new TF transform. -
When ROS shutsdown, if you have set the
commit
parameter (which defaults to true) the state of your publisher will be saved back to the yaml path.
- Need interface to set period of publishing. Should it be parameter, in the service call, or both?
- Need to make an explicit 'CreateTransform' service.