Thanks for your reply. I tried your configuration in isaac sim and it works well. But when I import it into the isaaclab through a edited version of “add_new_robot.py” , the robot model exploded, which was not the case in isaac sim.
Here’s my code and the model i’m using:
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
import argparse
from isaaclab.app import AppLauncher
# add argparse arguments
parser = argparse.ArgumentParser(
description="This script demonstrates adding a custom robot to an Isaac Lab environment."
)
parser.add_argument("--num_envs", type=int, default=1, help="Number of environments to spawn.")
# append AppLauncher cli args
AppLauncher.add_app_launcher_args(parser)
# parse the arguments
args_cli = parser.parse_args()
# launch omniverse app
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
import numpy as np
import torch
import isaaclab.sim as sim_utils
from isaaclab.actuators import ImplicitActuatorCfg
from isaaclab.assets import AssetBaseCfg
from isaaclab.assets.articulation import ArticulationCfg
from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
GEOTRUSSROVER_CONFIG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path="/home/houzhinan/Workspace/GeoTrussRover-simulation/opt_isaac/sqaure_D6test.usd",
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
rigid_body_enabled=True,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=100.0,
linear_damping=0.0,
angular_damping=0.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=False,
solver_position_iteration_count=8,
solver_velocity_iteration_count=4,
sleep_threshold=0.005,
stabilization_threshold=0.001,
),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.0),
rot=(1.0, 0.0, 0.0, 0.0),
lin_vel=(0.0, 0.0, 0.0),
ang_vel=(0.0, 0.0, 0.0),
),
actuators={
"prismatic_joints": ImplicitActuatorCfg(
joint_names_expr=[".*_pj.*"],
effort_limit=None,
velocity_limit=None,
stiffness=None,
damping=None,
),
# "revolute_joints": ImplicitActuatorCfg(
# joint_names_expr=[".*RevoluteJoint.*"],
# effort_limit=200.0,
# velocity_limit=50.0,
# stiffness=100.0,
# damping=10.0,
# ),
},
)
class NewRobotsSceneCfg(InteractiveSceneCfg):
"""Designs the scene."""
ground = AssetBaseCfg(
prim_path="/World/defaultGroundPlane",
spawn=sim_utils.GroundPlaneCfg(
physics_material=sim_utils.RigidBodyMaterialCfg(
static_friction=1.0,
dynamic_friction=1.0,
restitution=0.0,
)
)
)
# lights
dome_light = AssetBaseCfg(
prim_path="/World/Light",
spawn=sim_utils.DomeLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75))
)
# robot
GeoTrussRover = GEOTRUSSROVER_CONFIG.replace(prim_path="/GeoTrussRover")
def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
sim_dt = sim.get_physics_dt()
sim_time = 0.0
count = 0
while simulation_app.is_running():
# reset
if count % 500 == 0:
# reset counters
count = 0
# reset the scene entities to their initial positions offset by the environment origins
root_geotrussrover_state = scene["GeoTrussRover"].data.default_root_state.clone()
root_geotrussrover_state[:, :3] += scene.env_origins
root_geotrussrover_state[:, 2] = torch.maximum(
root_geotrussrover_state[:, 2],
torch.tensor(1.0, device=root_geotrussrover_state.device)
)
# copy the default root state to the sim
scene["GeoTrussRover"].write_root_pose_to_sim(root_geotrussrover_state[:, :7])
scene["GeoTrussRover"].write_root_velocity_to_sim(root_geotrussrover_state[:, 7:])
# copy the default joint states to the sim
joint_pos, joint_vel = (
scene["GeoTrussRover"].data.default_joint_pos.clone(),
scene["GeoTrussRover"].data.default_joint_vel.clone(),
)
scene["GeoTrussRover"].write_joint_state_to_sim(joint_pos, joint_vel)
# clear internal buffers
scene.reset()
print("[INFO]: Resetting GeoTrussRover state...")
# if count % 100 < 50:
# if scene["GeoTrussRover"].num_joints > 0:
# action = torch.zeros(scene["GeoTrussRover"].num_joints, device=scene.device)
# scene["GeoTrussRover"].set_joint_position_target(action)
scene.write_data_to_sim()
sim.step()
sim_time += sim_dt
count += 1
scene.update(sim_dt)
def main():
"""Main function."""
sim_cfg = sim_utils.SimulationCfg(
device=args_cli.device,
dt=1.0/60,
physx=sim_utils.PhysxCfg(
solver_type=1,
max_position_iteration_count=8,
max_velocity_iteration_count=4,
)
)
sim = sim_utils.SimulationContext(sim_cfg)
sim.set_camera_view([5.0, 5.0, 3.0], [0.0, 0.0, 1.0])
scene_cfg = NewRobotsSceneCfg(args_cli.num_envs, env_spacing=3.0)
scene = InteractiveScene(scene_cfg)
sim.reset()
print("[INFO]: Setup complete...")
if hasattr(scene["GeoTrussRover"], 'data'):
print(f"[DEBUG]: Root position: {scene['GeoTrussRover'].data.root_state_w[:, :3]}")
print(f"[DEBUG]: Root orientation: {scene['GeoTrussRover'].data.root_state_w[:, 3:7]}")
run_simulator(sim, scene)
if __name__ == "__main__":
main()
simulation_app.close()
Robot model file
https://github.com/lozoRUST/Robot_Model/blob/main/sqaure_D6test.usd