-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move remaining Pybullet code to dedicated modules (#1171)
- Using IDE functionality
- Loading branch information
1 parent
82211be
commit 424aef5
Showing
4 changed files
with
30 additions
and
28 deletions.
There are no files selected for viewing
28 changes: 3 additions & 25 deletions
28
src/envs/pybullet_robots.py → src/pybullet_helpers/motion_planning.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Other Pybullet utility functions.""" | ||
from __future__ import annotations | ||
|
||
from typing import List | ||
|
||
import pybullet as p | ||
|
||
|
||
def get_kinematic_chain(robot: int, end_effector: int, | ||
physics_client_id: int) -> List[int]: | ||
"""Get all of the free joints from robot base to end effector. | ||
Includes the end effector. | ||
""" | ||
kinematic_chain = [] | ||
while end_effector > -1: | ||
joint_info = p.getJointInfo(robot, | ||
end_effector, | ||
physicsClientId=physics_client_id) | ||
if joint_info[3] > -1: | ||
kinematic_chain.append(end_effector) | ||
end_effector = joint_info[-1] | ||
return kinematic_chain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters