You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to run OSC controllers with control_delta=False in robosuite in 1.5.0. However, it does not move as I expected. I attached two codes below.
While I debug robosuite, I noticed that input_type is set to delta even with control_delta=False. Thus, the robot was running with delta motion while users provide position in base frame.
Once I force to set input_type=absolute, now this line complains. I think there is something wrong in action space if I force to set input_type=absolute.
When I run the very similar implementation in robosuite 1.4.1, which is attached below, I observe the expected motion, meaning that the robot moves +0.1 m along all x, y, z axes from the initialized position.
Reproduction
import robosuite as suite
import numpy as np
from robosuite.controllers.composite.composite_controller_factory import refactor_composite_controller_config
arm_controller_config = suite.load_part_controller_config(
default_controller='OSC_POSITION',
)
options = {}
options['env_name'] = 'Door'
options['robots'] = 'UR5e'
robot = options['robots'][0] if isinstance(
options['robots'], list,
) else options['robots']
options['initialization_noise'] = None
options['controller_configs'] = refactor_composite_controller_config(
arm_controller_config, robot, ['right', 'left'],
)
arm_controller_config['control_delta'] = False
env = suite.make(
**options,
use_camera_obs=False, # Set to True if you want camera observations
has_offscreen_renderer=False,
has_renderer=True, # Enable on-screen rendering
control_freq=200, # Control frequency in Hz
)
obs = env.reset()
env.viewer.set_camera(camera_id=0)
target_move = 0.1 # 0.1 meters along x-axis
target = obs["robot0_eef_pos"] + np.array([target_move, target_move, target_move])
# Run a few steps to reach the target position
for i in range(1000):
# Set desired action in absolute frame
action = np.zeros(4)
action[:3] = target
# Send action to the environment
obs, reward, done, info = env.step(action)
# Render the environment for visualization
env.render()
# Close the environment
env.close()
Please try to run the above code in robosuite 1.5.0. The robot keeps moving and never converges to its desired state, which is +0.1 m in x, y, z axis from the initialized position.
import robosuite as suite
from robosuite.controllers import load_controller_config
import numpy as np
# Load controller configuration for OSC_POSITION
controller_config = load_controller_config(default_controller="OSC_POSITION")
controller_config['control_delta'] = False
# Create the environment with OSC_POSITION as the controller
env = suite.make(
env_name="Lift", # You can replace "Lift" with any other suitable task/environment
robots="Panda", # Choose your robot, e.g., Panda, Sawyer
controller_configs=controller_config,
use_camera_obs=False, # Set to True if you want camera observations
has_offscreen_renderer=False,
has_renderer=True, # Enable on-screen rendering
control_freq=200, # Control frequency in Hz
)
# Reset the environment
obs = env.reset()
env.viewer.set_camera(camera_id=0) # Optional: Adjust the camera view if using GUI
# Define the movement in x-axis (positive or negative for direction)
target_x_move = 0.1 # 0.1 meters
target = obs["robot0_eef_pos"] + np.array([target_x_move, target_x_move, target_x_move])
# Run a few steps to reach the target position
for i in range(1000): # Adjust range to control duration
# Get the current position of the robot end-effector
# current_pos = obs["robot0_eef_pos"]
# Set desired action in absolute frame
action = np.zeros(4)
action[:3] = target
# Send action to the environment
obs, reward, done, info = env.step(action)
# Render the environment for visualization
env.render()
# Close the environment
env.close()
Please try to run the above code in robosuite 1.4.1. In this code, the robot could successfully move to its desired state.
Expected behavior
The robot end-effector should converge to 0.1 m in all axes from the initialized position using robosuite 1.5.0.
The text was updated successfully, but these errors were encountered:
System Info
Information
I have been trying to run OSC controllers with
control_delta=False
in robosuite in 1.5.0. However, it does not move as I expected. I attached two codes below.While I debug robosuite, I noticed that
input_type
is set todelta
even withcontrol_delta=False
. Thus, the robot was running with delta motion while users provide position in base frame.Once I force to set
input_type=absolute
, now this line complains. I think there is something wrong in action space if I force to setinput_type=absolute
.When I run the very similar implementation in robosuite 1.4.1, which is attached below, I observe the expected motion, meaning that the robot moves +0.1 m along all x, y, z axes from the initialized position.
Reproduction
Expected behavior
The robot end-effector should converge to 0.1 m in all axes from the initialized position using robosuite 1.5.0.
The text was updated successfully, but these errors were encountered: