6. Floating base¶
space_reach defaults to satellite_arm7, a free-floating satellite with one seven-joint arm and one goal. It also accepts the bundled seven-link planar space_robot: a 500 kg base with two three-link arms (six joints). Both hands reach at once, each toward its own position goal; orientation is not a target. The base is unactuated and recoils as the arms move. The GUI replays the planar robot flat in its plane. Both robots have no gravity or ground.
This environment needs the floating-base package (see Install); without it
space_reach reports which package is missing. A robot standing on the ground is a different task, with
its own physics step: see Legged robots.
import redysim_rl
env = redysim_rl.make_vec("space_reach", num_envs=32, action_mode="impedance")
obs, info = env.reset(seed=0)
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
print(obs.shape, info["distance"].mean(), info["base_displacement"].mean())
Observation¶
For the bundled satellite arm (satellite_arm7, seven joints) the observation has 41 values:
| values | content |
|---|---|
| 7 + 7 | joint positions q and velocities dq |
| 3 | position of the base |
| 9 | rotation matrix of the base (row by row) |
| 6 | velocity of the base, inertial frame: linear, then angular |
| 3 + 3 | position and velocity of the tip of the chosen link (by default the hand, the last link) |
| 3 | goal minus the tip position |
The attitude of the base is handled with Euler parameters (a unit quaternion), so there is no
singularity; the observation gives the rotation matrix, a smooth representation. The base starts at
rest at the origin without rotation; the goal is the position of the tip at a random pose of the joints
(goal_range, 1 rad by default), so it is reachable.
Configuring¶
from redysim_rl import RedysimVectorEnv
from redysim_rl.floating import SpaceReach
task = SpaceReach(link=8, goal_range=0.8, tol=0.1, w_base=0.5) # penalise the base's rotation
env = RedysimVectorEnv(task, num_envs=16, action_mode="pd_target")
env.reset(seed=0)
link chooses one arm tip; by default every terminal arm link reaches, w_base weights the angular speed of the base in
the reward (0.1 by default), q_nominal the pose the joints start near (by default the home pose of the satellite arm; the starting pose of the planar space robot, or zeros for another robot). info["base_displacement"] gives how
far the base has moved. Another robot: robot= takes a redysim_floating.FloatingRobot or the name of a
bundled floating-base model. The force limit of the satellite arm is set joint by joint, from 40 N m at the
shoulder to 2 N m at the wrist (tau_limit= takes one value or one per joint): the inertia a joint moves
falls from about 2 kg m² to 0.002 kg m², and one limit for all of them would spin the wrist.
Limits are not conservative
The speed cap and the joint limits stop a joint abruptly, which for a free-floating robot is an
external impulse. With the default 3 rad/s cap random play (16 robots, 100 steps, actions of 5 % of the limit) moved the
centre of mass by up to 0.037 m; with the limits off (q_limits=(-1e3, 1e3), dq_limits=1e3) by 0.0026 m, the
integration error of a wrist that spins fast.
Set them wide when momentum matters.
Gains¶
For the PD modes the gains come from the inertia a joint feels with the base free (the joint block of the inertia matrix minus its coupling to the base), at random poses, then as in Action modes. Joints are all actuated; the base never gets a force.
For the planar two-hand robot, a historical 1M-step PPO run with goal_range=1.0 reached 0% of goals. goal_range=0.5 has not been tested.