@@ -590,10 +590,12 @@ def stack(self):
590
590
591
591
# ----------------------- i/o stuff
592
592
593
- def printline (self , ** kwargs ):
593
+ def printline (self , arg = None , ** kwargs ):
594
594
"""
595
595
Print pose in compact single line format (superclass method)
596
-
596
+
597
+ :param arg: value for orient option, optional
598
+ :type arg: str
597
599
:param label: text label to put at start of line
598
600
:type label: str
599
601
:param fmt: conversion format for each number as used by ``format()``
@@ -608,10 +610,23 @@ def printline(self, **kwargs):
608
610
:param file: file to write formatted string to. [default, stdout]
609
611
:type file: file object
610
612
611
-
612
613
Print pose in a compact single line format. If ``X`` has multiple
613
614
values, print one per line.
614
615
616
+ Orientation can be displayed in various formats:
617
+
618
+ ============= =================================================
619
+ ``orient`` description
620
+ ============= =================================================
621
+
622
+ ``'rpy/zyx'`` roll-pitch-yaw angles in ZYX axis order [default]
623
+ ``'rpy/yxz'`` roll-pitch-yaw angles in YXZ axis order
624
+ ``'rpy/zyx'`` roll-pitch-yaw angles in ZYX axis order
625
+ ``'eul'`` Euler angles in ZYZ axis order
626
+ ``'angvec'`` angle and axis
627
+ ============= =================================================
628
+
629
+
615
630
Example:
616
631
617
632
.. runblock:: pycon
@@ -620,6 +635,8 @@ def printline(self, **kwargs):
620
635
>>> x.printline()
621
636
>>> x = SE3.Rx([0.2, 0.3], 'rpy/xyz')
622
637
>>> x.printline()
638
+ >>> x.printline('angvec')
639
+ >>> x.printline(orient='angvec', fmt="{:.6f}")
623
640
>>> x = SE2(1, 2, 0.3)
624
641
>>> x.printline()
625
642
>>> SE3.Rand(N=3).printline(fmt='{:8.3g}')
@@ -631,6 +648,11 @@ def printline(self, **kwargs):
631
648
632
649
:seealso: :func:`trprint`, :func:`trprint2`
633
650
"""
651
+ if arg is not None and kwargs == {}:
652
+ if isinstance (arg , str ):
653
+ kwargs = dict (orient = arg )
654
+ else :
655
+ raise ValueError ('single argument must be a string' )
634
656
if self .N == 2 :
635
657
for x in self .data :
636
658
base .trprint2 (x , ** kwargs )
0 commit comments