Skip to content

Commit

Permalink
testing the robot class
Browse files Browse the repository at this point in the history
  • Loading branch information
lukestroh committed Nov 12, 2024
1 parent b60679a commit 99b4e82
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
Empty file.
1 change: 1 addition & 0 deletions pybullet_tree_sim/pruning_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ def main():
# data = data.reshape((cam_width * cam_height, 1), order="F")

# log.warning(f"joint angles: {penv.ur5.get_joint_angles()}")

return


Expand Down
28 changes: 27 additions & 1 deletion pybullet_tree_sim/robot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env python3
from pybullet_tree_sim.utils.pyb_utils import PyBUtils
import pybullet_tree_sim.utils.xacro_utils as xutils

from typing import Optional, Tuple
import numpy as np
import pybullet
Expand All @@ -7,7 +11,7 @@
class Robot:
def __init__(
self,
con,
pbclient,
robot_type: str,
robot_urdf_path: str,
tool_link_name: str,
Expand Down Expand Up @@ -46,6 +50,7 @@ def __init__(
self.control_joints = control_joints
self.robot_collision_filter_idxs = robot_collision_filter_idxs
self.setup_robot()
return

def setup_robot(self):
if self.robot is not None:
Expand Down Expand Up @@ -421,3 +426,24 @@ def unset_collision_filter_tree(self, collision_objects):
for i in collision_objects.values():
for j in range(self.num_joints):
self.con.setCollisionFilterPair(self.robot, i, j, 0, 1)


def main():
from pybullet_tree_sim.utils.pyb_utils import PyBUtils
pbutils = PyBUtils(renders=True)

robot = Robot(
pbclient=pbutils.pbclient,
robot_type='ur5e',
robot_urdf_path="",
tool_link_name="mock_pruner__tool0",
base_link_name="linear_slider__base_link",

)

print(robot)

return

if __name__ == "__main__":
main()

0 comments on commit 99b4e82

Please sign in to comment.