You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi gtsam support team, I tried to plot the marginal covariance matrix using plot_covariance_ellipse_3d. The inputs are axes, 3x1 point position , and 6x6 covariance matrix obtained from gtsam_marginals.marginalCovariance(keys[ii]). I have checked and ensured these input variables are good.
After running the code, I got the error shape mismatch: objects cannot be broadcast to a single shape.
The problem is related to this line:
The radii is actually a 6x1 vector instead of 3x1 vector as expected. An example of the radii I got is: [12.57294157 12.42959364 11.95267523 0.18826816 0.18105469 0.17589153].
I have tried to just take the first/last three element but this result in the incorrect estimation of the x,y,z:
The expected x/y/z is a 2d array (because they are the input of the axes.plot_surface) but here I got their shapes as (9, 9) (9, 9) (36, 9) respectively.
I use marginals = gtsam.Marginals(graph, initial) to extract marginals and iteratively obtain the covariance matrix (6x6 matrix) at each pose based on initial.keys()[ii].
I have plotted the pose positions (both before and after optimization) on these dataset without any issue, and got the error (as above) when I try to show the covariance matrix at each pose.
Expected behavior
The eclipses should be shown at each point
Environment
Python 3.8 in conda environment. Build from source
The text was updated successfully, but these errors were encountered:
Description
Hi gtsam support team, I tried to plot the marginal covariance matrix using
plot_covariance_ellipse_3d
. The inputs areaxes
,3x1 point position
, and6x6 covariance matrix obtained from gtsam_marginals.marginalCovariance(keys[ii])
. I have checked and ensured these input variables are good.After running the code, I got the error
shape mismatch: objects cannot be broadcast to a single shape
.The problem is related to this line:
gtsam/python/gtsam/utils/plot.py
Line 102 in 3e65779
The
radii
is actually a 6x1 vector instead of 3x1 vector as expected. An example of theradii
I got is:[12.57294157 12.42959364 11.95267523 0.18826816 0.18105469 0.17589153]
.I have tried to just take the first/last three element but this result in the incorrect estimation of the x,y,z:
gtsam/python/gtsam/utils/plot.py
Line 111 in 3e65779
The expected x/y/z is a 2d array (because they are the input of the
axes.plot_surface
) but here I got their shapes as (9, 9) (9, 9) (36, 9) respectively.Any comment is appreciated.
Steps to reproduce
marginals = gtsam.Marginals(graph, initial)
to extractmarginals
and iteratively obtain the covariance matrix (6x6 matrix) at each pose based oninitial.keys()[ii]
.Expected behavior
The eclipses should be shown at each point
Environment
Python 3.8 in conda environment. Build from source
The text was updated successfully, but these errors were encountered: