Printing SE3 with symbolic equations
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
The issue identifies the SE3 printing example, SE3_matrix.A, and NumPy formatting APIs, but no source file or test. Locate the SE3 printing entry point, reproduce the symbolic-matrix example, and verify that printed columns align to the longest term without changing the shown numeric formatting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello,
I noticed that matrices with long symbolic equations are printed very shrink.
I found my own priting method and I suggest to align them by the longest term like this:
def print_SE3(SE3_matrix : SE3):
SE3_numpy = SE3_matrix.A
max_item_length = SE3_numpy.astype(np.string_).dtype.itemsize
print(np.array2string(SE3_numpy,max_line_width=np.inf,precision=3,suppress_small=True,formatter = {'all':lambda x: f"{str(x):{max_item_length}}"}))
or:
def print_SE3(SE3_matrix : SE3):
SE3_numpy = SE3_matrix.A
max_item_length = SE3_numpy.astype(np.string_).dtype.itemsize
with np.printoptions(precision=3, suppress=True, linewidth = np.inf, formatter = {'all':lambda x: f"{str(x):{max_item_length}}"}):
print(SE3_numpy)
Results without print_SE3:
-1.0*sin(theta2)*cos(theta1) 1.0*sin(theta1) 1.0*cos(theta1)*cos(theta2) (d3 + l2)*cos(theta1)*cos(theta2)
-1.0*sin(theta1)*sin(theta2) -1.0*cos(theta1) 1.0*sin(theta1)*cos(theta2) (d3 + l2)*sin(theta1)*cos(theta2)
1.0*cos(theta2) 0 1.0*sin(theta2) l1 + (d3 + l2)*sin(theta2)
0 0 0 1
Results with print_SE3:
[[-1.0*sin(theta2)*cos(theta1) 1.0*sin(theta1) 1.0*cos(theta1)*cos(theta2) (d3 + l2)*cos(theta1)*cos(theta2)]
[-1.0*sin(theta1)*sin(theta2) -1.0*cos(theta1) 1.0*sin(theta1)*cos(theta2) (d3 + l2)*sin(theta1)*cos(theta2)]
[1.0*cos(theta2) 0 1.0*sin(theta2) l1 + (d3 + l2)*sin(theta2) ]
[0 0 0 1 ]]
I know that this function could be better so the inner columns should have less separation but I think it's good first step towards the good change.
- Lingua principale
- Python
- Stelle
- 641
- Fork
- 102
- Merge medio
- 1g 18h
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rai-opensource/spatialmath-python
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rai-opensource/spatialmath-python#32 · 4 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 50/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
bug
rai-opensource/spatialmath-python#165 · 2 commenti · 1 assegnatario ·
-
Type-check spatialmath Aperta
rai-opensource/spatialmath-python#143 · 8 commenti · 1 assegnatario ·
Tutte le issue di rai-opensource/spatialmath-python
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
zostera/django-bootstrap4#894 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
use-agent-os/agent-os#3276 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NousResearch/hermes-agent#117848 ·