Skip to content

Commit

Permalink
Better view configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderFabisch committed Sep 28, 2024
1 parent 544944e commit 725672a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/visualizations/vis_probabilistic_robot_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def animation_callback(
# %%
# define the joint angles,
thetas = np.array([1, 1, 1, 0, 1, 0])
for joint_name, theta in zip(joint_names, thetas):
current_thetas = -0.5 * thetas
for joint_name, theta in zip(joint_names, current_thetas):
tm.set_joint(joint_name, theta)

# %%
Expand All @@ -297,7 +298,7 @@ def animation_callback(
#
# Then we can finally use PPOE to compute the end-effector pose and its
# covariance.
T, cov = tm.probabilistic_forward_kinematics(thetas, covs)
T, cov = tm.probabilistic_forward_kinematics(current_thetas, covs)

# %%
# We compute the 3D projection of the 6D covariance matrix.
Expand All @@ -310,7 +311,7 @@ def animation_callback(
fig.plot_transform(np.eye(4), s=0.3)
surface = Surface(x, y, z, c=(0, 0.5, 0.5))
surface.add_artist(fig)
fig.view_init(elev=-20)
fig.view_init(elev=5, azim=50)
n_frames = 200
if "__file__" in globals():
fig.animate(animation_callback, n_frames, loop=True,
Expand Down

0 comments on commit 725672a

Please sign in to comment.