Skip to content

Commit 83d49fd

Browse files
committed
black/flake8 updates
1 parent f65bbd4 commit 83d49fd

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

pybullet_tree_sim/robot.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def __init__(
5757
else init_joint_angles
5858
)
5959

60+
self.reset_robot()
61+
6062
# Robot setup
6163
self.robot = None
6264
# Load robot URDF config
@@ -306,16 +308,20 @@ def _get_sensor_attributes(self) -> dict:
306308
sensor_attributes.update({Path(file).stem: yamlcontent})
307309
return sensor_attributes
308310

309-
def reset_robot(self):
311+
def reset_robot(self, joint_angles: tuple = None) -> None:
310312
if self.robot is None:
311313
return
312314
self.init_joint_angles = (
313-
-np.pi / 2,
314-
-np.pi * 2 / 3,
315-
np.pi * 2 / 3,
316-
-np.pi,
317-
-np.pi / 2,
318-
np.pi,
315+
(
316+
-np.pi / 2 + np.pi / 4,
317+
-np.pi * 2 / 3,
318+
np.pi * 2 / 3,
319+
-np.pi,
320+
-np.pi / 2,
321+
0,
322+
)
323+
if joint_angles is None
324+
else joint_angles
319325
)
320326
self.set_joint_angles_no_collision(self.init_joint_angles)
321327
return
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env python3
22
import math
33

4+
45
def roundup(x):
56
return math.ceil(x / 10.0) * 10
67

8+
79
def rounddown(x):
8-
return math.floor(x / 10.0) * 10
10+
return math.floor(x / 10.0) * 10

0 commit comments

Comments
 (0)