0
$\begingroup$

Rosanswers logo

Hi!! I'm trying to use the tf_remap node without making a launch file. The problem is that the mapping should be specified in the ~mappings parameter of the tf_remap node. I tried this but it does not work:

$ rosparam set /tf_remap/~mappings "[{/neck_2: /neck_1}, {/left_shoulder_2: /left_shoulder_1}, {/left_elbow_2: /left_elbow_1}]"
$ rosparam get /tf_remap/~mappings
- {/neck_2: /neck_1}
- {/left_shoulder_2: /left_shoulder_1}
- {/left_elbow_2: /left_elbow_1}
$ rosrun tf tf_remap __name:=tf_remap
Applying the following mappings to incoming tf frame ids {}

I've studied the ros name convention and everything seems fine from my point of view. Any Idea?


EDITED after the bhaskara suggestion:

I also tested the below example and it does not work:

$ rosparam get /tf_remap/mappings
- {/neck_2: /neck_1}
- {/left_shoulder_2: /left_shoulder_1}
- {/left_elbow_2: /left_elbow_1}

$ rosrun tf tf_remap __name:=tf_remap
Applying the following mappings to incoming tf frame ids {}

EDITED: Third attempt:

$ rosbag play gesture_recording.bag tf:=tf_old &

#brute force:
$ rosparam set mappings "[{old: /neck_2,new: /neck_1}]"
$ rosparam set /mappings "[{old: /neck_2,new: /neck_1}]"
$ rosparam set tf_remap/mappings "[{old: /neck_2,new: /neck_1}]"
$ rosparam set /tf_remap/mappings "[{old: /neck_2,new: /neck_1}]"

$ rosrun tf tf_remap &
Applying the following mappings to incoming tf frame ids {}
$ rostopic echo /tf

> [...]
> -- transforms: 
>   - 
>     header: 
>       seq: 0
>       stamp: 
>         secs: 1320600273
>         nsecs: 859003197
>       frame_id: /openni_depth_frame
>     child_frame_id: /neck_2
>     transform: 
>       translation: 
>         x: 1.68099461393
>         y: -0.25899046843
>         z: 0.235416310719
>       rotation: 
>         x: 0.279471530986
>         y: 0.53708064566
>         z: 0.633364982269
>         w: 0.481963528351
> --- transforms:  
> [...]

Also tested with the same results:

rosrun tf tf_remap _mappings:='{old: /neck_2, new: /neck_1}' 

Originally posted by Pablo Iñigo Blasco on ROS Answers with karma: 2982 on 2011-11-09

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I have recently come across the same problem. I continued your brute-force and found a working command:

rosrun tf tf_remap _mappings:='[{old: /neck_2, new: /neck_1}]' 
Applying the following mappings to incoming tf frame ids {'/neck_2': '/neck_1'}

Originally posted by sergey_alexandrov with karma: 260 on 2011-12-04

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Pablo Iñigo Blasco on 2011-12-04:
It worked :-)

Comment by Benoit Larochelle on 2013-03-04:
Remember to play the bag with rosbag play x.bag /tf:=/tf_old (Thanks to @Ben_S)

$\endgroup$
0
$\begingroup$

Rosanswers logo

You don't need the ~: just do 'rosparam set /tf_echo/mappings'. '~' is not used when the name is already fully qualified (starts with '/').


Originally posted by bhaskara with karma: 1479 on 2011-11-09

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by bhaskara on 2011-11-14:
Each of those is subtly wrong in a different way :) the first one needs to set the node name as you were doing earlier with '__name:=tf_remap'. The second one needs to enclose the map in a vector, i.e. [{old: /neck_2, ...}] (note the square brackets).

Comment by Pablo Iñigo Blasco on 2011-11-14:
certainly bhaskara. I also tried your suggestion in a third attempt (edited post) with the same results. It is strange, your suggestion seems to be absolutely coherent with the remap documentation: ~mappings ([ {str: str} ], default: []) 'each dictionary in the list must have an "old" and "new" key'

Comment by bhaskara on 2011-11-10:
Your edited comment doesn't match what I typed. Look carefully :)

Comment by Pablo Iñigo Blasco on 2011-11-10:
which parameter is also incorrect? I tried what you say (see edited comment) :-) I don't understand what do you mean. thanks for the interest :-)

Comment by bhaskara on 2011-11-10:
The parameter value is also incorrect. Try something like 'rosparam set /tf_remap/mappings "[{old: /neck_2, new: /neck_1}]"'.

Comment by Pablo Iñigo Blasco on 2011-11-09:
I tried also that and does not work:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.