From 725672afed1303c5df701a80a9c33b44d9ff94ba Mon Sep 17 00:00:00 2001 From: Alexander Fabisch Date: Sat, 28 Sep 2024 17:35:28 +0200 Subject: [PATCH] Better view configuration --- .../visualizations/vis_probabilistic_robot_kinematics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/visualizations/vis_probabilistic_robot_kinematics.py b/examples/visualizations/vis_probabilistic_robot_kinematics.py index 5a13c68d..70078c12 100644 --- a/examples/visualizations/vis_probabilistic_robot_kinematics.py +++ b/examples/visualizations/vis_probabilistic_robot_kinematics.py @@ -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) # %% @@ -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. @@ -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,