5 import tf.transformations
as trans
6 from rospy_message_converter
import message_converter
7 _to_msg = message_converter.convert_dictionary_to_ros_message
8 _type_name =
'visualization_msgs/InteractiveMarker' 11 if node.value[0] !=
'/':
12 file_name = os.path.join(os.path.dirname(loader.name), node.value)
14 file_name = node.value
15 with file(file_name)
as inputfile:
16 return yaml.load(inputfile)
19 val = [float(v.value)
for v
in node.value]
20 quat = trans.quaternion_from_euler(*val)
21 return {
'x': quat[0],
'y': quat[1],
'z': quat[2],
'w': quat[3]}
24 msgclass = roslib.message.get_message_class(node.value[0].value)
25 return getattr(msgclass, node.value[1].value)
27 yaml.add_constructor(
"!include", _include)
28 yaml.add_constructor(
"!euler", _to_quat)
29 yaml.add_constructor(
"!enum", _to_uint)
30 yaml.add_constructor(
"!degrees",
lambda loader, node: np.deg2rad(float(node.value)))
34 for k, v
in config.items():
35 config[k][
'interactive_marker'] =
_to_msg(_type_name, v[
'interactive_marker'])
39 with open(file_name)
as f:
def _to_uint(loader, node)
def _to_quat(loader, node)
def _include(loader, node)