def combine_transforms(t_first, t_second, fro, to):
 fro = _to_const(fro)
 to = _to_const(to)
 if (t_first['from'] != fro):
  raise RuntimeError(('From mismatch: %s ("%s") != %s ("%s")' % (t_first['from'], _coord_frame_name(t_first['from']), fro, _coord_frame_name(fro))))
 if (t_first['to'] != t_second['from']):
  raise RuntimeError(('Transform mismatch: t1["to"] = %s ("%s"), t2["from"] = %s ("%s")' % (t_first['to'], _coord_frame_name(t_first['to']), t_second['from'], _coord_frame_name(t_second['from']))))
 if (t_second['to'] != to):
  raise RuntimeError(('To mismatch: %s ("%s") != %s ("%s")' % (t_second['to'], _coord_frame_name(t_second['to']), to, _coord_frame_name(to))))
 return Transform(fro, to, np.dot(t_second['trans'], t_first['trans']))

def combine_transforms ( t_first , t_second , fro , to ) : fro = _to_const ( fro ) to = _to_const ( to ) if ( t_first [ 'from' ] != fro ) : raise RuntimeError ( ( 'From mismatch: %s ("%s") != %s ("%s")' % ( t_first [ 'from' ] , _coord_frame_name ( t_first [ 'from' ] ) , fro , _coord_frame_name ( fro ) ) ) ) if ( t_first [ 'to' ] != t_second [ 'from' ] ) : raise RuntimeError ( ( 'Transform mismatch: t1["to"] = %s ("%s"), t2["from"] = %s ("%s")' % ( t_first [ 'to' ] , _coord_frame_name ( t_first [ 'to' ] ) , t_second [ 'from' ] , _coord_frame_name ( t_second [ 'from' ] ) ) ) ) if ( t_second [ 'to' ] != to ) : raise RuntimeError ( ( 'To mismatch: %s ("%s") != %s ("%s")' % ( t_second [ 'to' ] , _coord_frame_name ( t_second [ 'to' ] ) , to , _coord_frame_name ( to ) ) ) ) return Transform ( fro , to , np . dot ( t_second [ 'trans' ] , t_first [ 'trans' ] ) )
combine two transforms .