Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python binding for no gravity link #1419

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/src/sdf/pyLink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ void defineLink(pybind11::object module)
.def("set_enable_wind",
&sdf::Link::SetEnableWind,
"Set whether this link should be subject to wind.")
.def("enable_gravity",
&sdf::Link::EnableGravity,
"Check if this link should be subject to gravity. "
"If true, this link should be affected by gravity.")
.def("set_enable_gravity",
&sdf::Link::SetEnableGravity,
"Set whether this link should be subject to gravity.")
.def("add_collision",
&sdf::Link::AddCollision,
"Add a collision to the link.")
Expand Down
4 changes: 4 additions & 0 deletions python/test/pyLink_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def test_default_construction(self):
link.set_enable_wind(True)
self.assertTrue(link.enable_wind())

self.assertTrue(link.enable_gravity())
link.set_enable_gravity(False)
self.assertFalse(link.enable_gravity())

self.assertEqual(0, link.sensor_count())
self.assertEqual(None, link.sensor_by_index(0))
self.assertEqual(None, link.sensor_by_index(1))
Expand Down
Loading