Skip to content

Conversation

@yvvonie
Copy link

@yvvonie yvvonie commented Jan 27, 2026

Description

Add PushBall RL environment

Added PushBallEnv class that defines the task of pushing a soccer ball to a goal using UR10.
Added training and gym configs for PushBall.

Changes

  • configs/agents/rl/push_ball/gym_config.json
  • configs/agents/rl/push_ball/train_config.json
  • embodichain/lab/gym/envs/tasks/rl/push_ball.py

Checklist

  • I have added PushBallRL task environment.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new reinforcement learning environment for pushing a soccer ball to a goal using a UR10 robot arm. The implementation follows the existing pattern from the PushCubeRL environment but introduces several inconsistencies and configuration issues.

Changes:

  • Added PushBallGateEnv class implementing the ball pushing task with goal checking and truncation logic
  • Added training configuration with PPO algorithm settings
  • Added gym configuration with robot setup, ball physics, events, observations, and reward functions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

File Description
embodichain/lab/gym/envs/tasks/rl/push_ball.py New RL environment class for ball pushing task with success/failure logic
configs/agents/rl/push_ball/train_config.json Training configuration with PPO hyperparameters and network architecture
configs/agents/rl/push_ball/gym_config.json Environment configuration including robot, ball, events, observations, and rewards

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +179 to +180
"background": []
}
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gym_config is missing several sections that are present in the push_cube gym_config for consistency. Consider adding empty arrays for sensor (line 161 of push_cube), light (line 162), rigid_object_group (line 188), and articulation (line 189) sections to maintain consistent structure across environment configurations.

Copilot uses AI. Check for mistakes.
}
},
"control_parts": {
"arm": ["Joint[1-6]"]
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The control_parts pattern uses ["Joint[1-6]"] while the push_cube config uses ["JOINT[1-6]"] (uppercase). This inconsistency in casing could potentially cause issues if the pattern matching is case-sensitive. Verify that this is the intended pattern or align with the existing convention.

Copilot uses AI. Check for mistakes.
},
"extensions": {
"action_type": "delta_qpos",
"obs_mode": "state",
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The obs_mode field is present in the extensions section but is not present in the push_cube gym_config (only in extensions at line 113-118 of push_cube, which doesn't include obs_mode). Verify if this field is required or if it should be removed for consistency with the existing configuration pattern.

Copilot uses AI. Check for mistakes.
Comment on lines +169 to +170
"static_friction": 3.0,
"dynamic_friction": 2.5,
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The soccer ball has unusually high friction values: static_friction: 3.0 and dynamic_friction: 2.5. Real soccer balls typically have much lower friction coefficients (around 0.3-0.6). These high values may make the ball behave unrealistically, making it difficult to push and roll. Consider using more realistic values unless high friction is intentionally desired for the task.

Suggested change
"static_friction": 3.0,
"dynamic_friction": 2.5,
"static_friction": 0.5,
"dynamic_friction": 0.4,

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +41
def _init_sim_state(self, **kwargs):
super()._init_sim_state(**kwargs)
self.ball = self.sim.get_rigid_object("soccer_ball")
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation caches the ball object in _init_sim_state, which is inconsistent with the pattern used in push_cube.py (line 42, 62) where the object is retrieved directly in each method using self.sim.get_rigid_object("cube"). For consistency with the existing codebase, consider retrieving the object directly in each method rather than caching it here.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +6
"num_envs": 128,
"sim_steps_per_control": 4,
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The num_envs and sim_steps_per_control fields are specified at the top-level env section but are not present in the push_cube gym_config structure. In the push_cube setup, these settings appear to be managed differently (push_cube train_config has num_envs in the trainer section). This inconsistency in configuration structure could lead to confusion about which settings take precedence.

Copilot uses AI. Check for mistakes.
"body_type": "dynamic",
"init_pos": [0.35, 0.0, 0.05],
"attrs": {
"mass": 3.0,
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The soccer ball mass is set to 3.0 kg, which is significantly heavier than a standard soccer ball (typically 0.4-0.45 kg). This heavy mass combined with high friction values will make the ball very difficult to push and may not represent realistic soccer ball dynamics. Consider using a more realistic mass value unless a heavy ball is intentionally desired for the task.

Suggested change
"mass": 3.0,
"mass": 0.43,

Copilot uses AI. Check for mistakes.


@register_env("PushBallRL", max_episode_steps=100, override=True)
class PushBallGateEnv(RLEnv):
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class name PushBallGateEnv is inconsistent with the codebase naming convention. The existing environment PushCubeEnv follows the pattern of using the registered name without "Gate". For consistency, this should be renamed to PushBallEnv to match the registration name PushBallRL.

Suggested change
class PushBallGateEnv(RLEnv):
class PushBallEnv(RLEnv):

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +13
"trainer": {
"exp_name": "push_ball_ppo",
"seed": 42,
"device": "cuda:0",
"headless": true,
"iterations": 1000,
"rollout_steps": 1024,
"eval_freq": 200,
"save_freq": 200,
"use_wandb": false,
"gym_config": "configs/agents/rl/push_ball/gym_config.json"
},
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The train_config structure is inconsistent with the existing push_cube train_config. The push_cube config (lines 8-16) includes additional fields like enable_rt, gpu_id, num_envs, and wandb_project_name in the trainer section. Additionally, push_cube has an events section for evaluation. Consider aligning the structure with the existing configuration for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +24
"env": {
"id": "PushBallRL",
"cfg": {
"num_envs": 64,
"sim_steps_per_control": 4,
"extensions": {
"obs_mode": "state",
"episode_length": 100
}
}
},
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The env section in this train_config appears redundant and inconsistent with the push_cube train_config structure. The push_cube config does not have an env section at this level, as environment configuration is typically handled in the gym_config.json file referenced in the trainer section. This redundancy could cause confusion about which settings take precedence.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant