@@ -34,6 +34,14 @@ WorldState mock_world_state() {
3434 return WorldState ({obstacle}, {transform});
3535}
3636
37+ // Add this function after `fake_bounding_regions()` or similar helper functions.
38+ Motion::pseudolinear_constraint fake_pseudolinear_constraint () {
39+ Motion::pseudolinear_constraint plc;
40+ plc.line_tolerance_factor = 0 .5f ;
41+ plc.orientation_tolerance_factor = 0 .75f ;
42+ return plc;
43+ }
44+
3745BOOST_AUTO_TEST_SUITE (test_mock)
3846
3947BOOST_AUTO_TEST_CASE (mock_get_api) {
@@ -175,11 +183,19 @@ BOOST_AUTO_TEST_CASE(test_move_and_get_pose) {
175183 BOOST_CHECK_EQUAL (pose, init_fake_pose ());
176184
177185 auto ws = std::make_shared<WorldState>(mock_world_state ());
178- bool success = client.move (fake_pose (), fake_component_name (), ws, nullptr , fake_map ());
186+ // Create a constraints object with the new pseudolinear constraint
187+ auto constraints = std::make_shared<Motion::constraints>();
188+ constraints->pseudolinear_constraints .push_back (fake_pseudolinear_constraint ());
189+ bool success = client.move (fake_pose (), fake_component_name (), ws, constraints, fake_map ()); // Pass the new constraints object
179190 BOOST_TEST (success);
180191
181192 pose = client.get_pose (fake_component_name (), destination_frame, transforms, fake_map ());
182193 BOOST_CHECK_EQUAL (pose, fake_pose ());
194+ // Add checks for the peek_constraints in the mock
195+ BOOST_CHECK (mock->peek_constraints != nullptr );
196+ BOOST_CHECK_EQUAL (mock->peek_constraints ->pseudolinear_constraints .size (), 1 );
197+ BOOST_CHECK_CLOSE (mock->peek_constraints ->pseudolinear_constraints [0 ].line_tolerance_factor .get (), fake_pseudolinear_constraint ().line_tolerance_factor .get (), 0.0001 );
198+ BOOST_CHECK_CLOSE (mock->peek_constraints ->pseudolinear_constraints [0 ].orientation_tolerance_factor .get (), fake_pseudolinear_constraint ().orientation_tolerance_factor .get (), 0.0001 );
183199 });
184200}
185201
@@ -281,4 +297,4 @@ BOOST_AUTO_TEST_SUITE_END()
281297
282298} // namespace motion
283299} // namespace sdktests
284- } // namespace viam
300+ } // namespace viam
0 commit comments