Skip to content
Closed
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.25)

project(
rcs
Expand Down
17 changes: 11 additions & 6 deletions python/examples/grasp_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import mujoco
import numpy as np
from rcs._core.common import Pose
from rcs.envs.creators import FR3SimplePickUpSimEnvCreator
from rcs.envs.base import GripperWrapper, RobotEnv

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -50,10 +51,10 @@ def plan_linear_motion(self, geom_name: str, delta_up: float, num_waypoints: int
return self.generate_waypoints(end_eff_pose, goal_pose, num_waypoints=num_waypoints)

def execute_motion(self, waypoints: list[Pose], gripper: float = GripperWrapper.BINARY_GRIPPER_OPEN) -> dict:
for i in range(1, len(waypoints)):
for i in range(len(waypoints)):
# calculate delta action
delta_action = waypoints[i] * waypoints[i - 1].inverse()
obs = self.step(self._action(delta_action, gripper))
# delta_action = waypoints[i] * waypoints[i - 1].inverse()
obs = self.step(self._action(waypoints[i], gripper))
return obs

def approach(self, geom_name: str):
Expand Down Expand Up @@ -83,10 +84,14 @@ def pickup(self, geom_name: str):

def main():
# compatilbe with rcs/SimplePickUpSimDigitHand-v0 and rcs/SimplePickUpSim-v0
env = gym.make(
"rcs/SimplePickUpSimDigitHand-v0",
# env = gym.make(
# "rcs/SimplePickUpSimDigitHand-v0",
# render_mode="human",
# delta_actions=True,
# )
env = FR3SimplePickUpSimEnvCreator()(
render_mode="human",
delta_actions=True,
delta_actions=False,
)
env.reset()
print(env.unwrapped.robot.get_cartesian_position().translation()) # type: ignore
Expand Down
Loading