Skip to content

Commit f3a5953

Browse files
committed
updates to robot.py for generic robot construction
1 parent 7894304 commit f3a5953

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2+
## TODO:
3+
Look up Cantera
4+
15
urdf generic launch CLI test:
26
`xacro robot.urdf.xacro > test.urdf end_effector_type:=mock_pruner eef_parent:=ur5e__tool0 arm_type:=ur5 ur_type:=ur5e tf_prefix:=ur5e__ base_attachment_type:=linear_slider`
37

@@ -7,7 +11,7 @@ urdf generic launch CLI test:
711
1. For Claire:
812
1. Figure out best way to manage tree/robot/environment interaction. I removed robot from penv, but self.trees still exists.
913
1. Fill out the `object_loader.py` class. Activate/deactivate trees, supports, robots.
10-
1. Find the `TODO`s in all the code. Ask Luke what they mean and discuss solutions.
14+
1. Find the `TODO`s in all the code. Ask Luke what they meana and discuss solutions.
1115
1. Format the final approach controller as a python subpackage?
1216
1. https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#packaging-namespace-packages
1317
1. Add basic cylinder to world. Dynamically create URDF.

pybullet_tree_sim/robot.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ def __init__(
4646
self.randomize_pose = randomize_pose # TODO: This isn't set up anymore... fix
4747
self.init_joint_angles = (
4848
(
49-
-np.pi / 2,
49+
-np.pi / 2 + np.pi / 4,
5050
-np.pi * 2 / 3,
5151
np.pi * 2 / 3,
5252
-np.pi,
5353
-np.pi / 2,
54-
np.pi,
54+
0,
5555
)
5656
if init_joint_angles is None
5757
else init_joint_angles
@@ -112,7 +112,8 @@ def _generate_robot_urdf(self) -> None:
112112
self.robot_conf.update(part_conf)
113113
else:
114114
raise ValueError(f"Robot part {robot_part} not found in {self._robot_configs_path}")
115-
115+
116+
log.warn(self.robot_conf)
116117
# Generate URDF from mappings
117118
robot_urdf = xutils.load_urdf_from_xacro(
118119
xacro_path=self._robot_xacro_path,
@@ -183,7 +184,7 @@ def _get_joints(self) -> dict:
183184
return joints
184185

185186
def _assign_control_joints(self, joints: dict) -> list:
186-
"""Get list of controllabe joints from the joint dict by joint type"""
187+
"""Get list of controllable joints from the joint dict by joint type"""
187188
control_joints = []
188189
control_joint_idxs = []
189190
for joint, joint_info in joints.items():
@@ -712,6 +713,7 @@ def deproject_pixels_to_points(
712713
return sensor_coords
713714
elif return_frame == "world":
714715
world_coords = (mr.TransInv(view_matrix) @ sensor_coords.T).T
716+
log.err("HELLO WORLD")
715717
if debug:
716718
plot.debug_deproject_pixels_to_points(
717719
sensor=sensor,
@@ -831,7 +833,7 @@ def get_key_sensor_action(self, keys_pressed: list) -> dict | None:
831833
depth = depth.reshape((sensor.depth_width * sensor.depth_height, 1), order="F")
832834

833835
camera_points = self.deproject_pixels_to_points(
834-
sensor=sensor, data=depth, view_matrix=view_matrix, return_frame="sensor"
836+
sensor=sensor, data=depth, view_matrix=view_matrix, return_frame="world", debug=False,
835837
)
836838

837839
sensor_data.update(

0 commit comments

Comments
 (0)