Skip to content
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
6 changes: 3 additions & 3 deletions pyrep/objects/joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def set_joint_position(self, position: float,
when the joint mode is in Force mode. It will disable dynamics,
move the joint, and then re-enable dynamics.

:param positions: A list of positions of the joints (angular or linear
:param position: Position of a joint (angular or linear
values depending on the joint type).
"""
if not disable_dynamics:
Expand All @@ -65,11 +65,11 @@ def set_joint_position(self, position: float,
sim.simSetJointPosition(self._handle, position)
self.set_joint_target_position(position)

with utils.step_lock:
sim.simExtStep(True) # Have to step for changes to take effect
# Re-enable the dynamics
sim.simSetModelProperty(self._handle, prior)
self.set_model(is_model)
with utils.step_lock:
sim.simExtStep(True) # Have to step for changes to take effect

def get_joint_target_position(self) -> float:
"""Retrieves the target position of a joint.
Expand Down
8 changes: 4 additions & 4 deletions pyrep/robots/configuration_paths/arm_configuration_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ def step(self) -> bool:
self._path_done = done
return done

def set_to_start(self) -> None:
def set_to_start(self, disable_dynamics=False) -> None:
"""Sets the arm to the beginning of this path.
"""
start_config = self._path_points[:len(self._arm.joints)]
self._arm.set_joint_positions(start_config)
self._arm.set_joint_positions(start_config, disable_dynamics=disable_dynamics)
self._path_done = False

def set_to_end(self) -> None:
def set_to_end(self, disable_dynamics=False) -> None:
"""Sets the arm to the end of this path.
"""
final_config = self._path_points[-len(self._arm.joints):]
self._arm.set_joint_positions(final_config)
self._arm.set_joint_positions(final_config, disable_dynamics=disable_dynamics)

def visualize(self) -> None:
"""Draws a visualization of the path in the scene.
Expand Down
5 changes: 2 additions & 3 deletions pyrep/robots/robot_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,11 @@ def set_joint_positions(self, positions: List[float],
for jh, p in zip(self._joint_handles, positions)]
[j.set_joint_target_position(p) # type: ignore
for j, p in zip(self.joints, positions)]

with utils.step_lock:
sim.simExtStep(True) # Have to step for changes to take effect
# Re-enable the dynamics
sim.simSetModelProperty(self._handle, prior)
self.set_model(is_model)
with utils.step_lock:
sim.simExtStep(True) # Have to step for changes to take effect

def get_joint_target_positions(self) -> List[float]:
"""Retrieves the target positions of the joints.
Expand Down