diff --git a/math/normalize_vector.h b/math/normalize_vector.h index ea3a122515c8..357083e541aa 100644 --- a/math/normalize_vector.h +++ b/math/normalize_vector.h @@ -40,10 +40,10 @@ void NormalizeVector( if (ddx_norm) { auto dx_norm_transpose = transposeGrad(*dx_norm, x.rows()); - auto ddx_norm_times_norm = -matGradMultMat( + auto minus_ddx_norm_times_norm = matGradMultMat( x_norm, x_norm.transpose(), (*dx_norm), dx_norm_transpose); auto dnorm_inv = -x.transpose() / (xdotx * norm_x); - (*ddx_norm) = ddx_norm_times_norm / norm_x; + (*ddx_norm) = -minus_ddx_norm_times_norm / norm_x; auto temp = (*dx_norm) * norm_x; typename Derived::Index n = x.rows(); for (int col = 0; col < n; col++) { diff --git a/systems/rendering/test/pose_aggregator_test.cc b/systems/rendering/test/pose_aggregator_test.cc index 36a2fbca8e1d..a66448b195ab 100644 --- a/systems/rendering/test/pose_aggregator_test.cc +++ b/systems/rendering/test/pose_aggregator_test.cc @@ -208,9 +208,10 @@ TEST_F(PoseAggregatorTest, AddSinglePoseAndVelocityPorts) { // Tests that PoseBundle supports Symbolic form. GTEST_TEST(PoseBundleTest, Symbolic) { PoseBundle dut{1}; - + multibody::SpatialVelocity msv = + dut.get_velocity(0).get_velocity(); // Just sanity check that some element got zero-initialized. - const symbolic::Expression& x = dut.get_velocity(0).get_velocity()[0]; + const symbolic::Expression& x = msv[0]; EXPECT_TRUE(x.EqualTo(0.0)); }