gymapi.AssetOptions().fix_base_link = False -> URDF has gone

fixed_problem

I use Joint_monkey.py and convert file with
Solidworks → URDF by ROS’s convert program (sw_urdf_exporter - ROS Wiki)

gymapi.AssetOptions().fix_base_link = False → Model Gone
gymapi.AssetOptions().fix_base_link = True → Model show up

python file: joint_monkey.py (9.6 KB)
URDF file: quadruped_v2_edit6.urdf (17.7 KB)
Entire File: quadruped_v2_edit6.zip (5.3 MB)

Did I miss something?
I’m very new in SW → URDF method

My urdf skill resolved this problem.
I don’t know what was exactly problem
but I changed my whole urdf by typing one by one
than it works

I think the problem is the “effort” and “velocity” default values in your URDF files, if you put them to zero the URDF won’t be uploaded correctly. This might be a bug, I’m not sure! :)

2 Likes

I’ll try this solution again
Thanks for your opinion!
I hope this is right solution 😁

I had this exact problem, and it was resolved by setting values for both effort and velocity limits to a non-zero value in my URDF.

Thanks.

1 Like

I checked another file from https://github.com/leggedrobotics/legged_gym/blob/master/resources/robots/a1/urdf/a1.urdf

This file set all effort & velocity to non-zero but base_fix() problem doesn’t solved.
Does joint type=fixed also need ‘effort’ & ‘velocity’ ?

This a1 URDF has a different problem I think, I can load it but the links are separated.

1 Like

The a1 is indeed strangely put together, but it loads fine also with fix base link set to false.

You only need to set effort and velocity limits for movable joints i.e. DOFs, not for fixed joints, they are ignored as a DOF. For a1 it looks like this:

======== Asset info a1: ========
Got 23 bodies, 22 joints, and 12 DOFs
Bodies:
  0: 'base'
  1: 'trunk'
  2: 'FL_hip'
  3: 'FL_thigh_shoulder'
  4: 'FL_thigh'
  5: 'FL_calf'
  6: 'FL_foot'
  7: 'FR_hip'
  8: 'FR_thigh_shoulder'
  9: 'FR_thigh'
 10: 'FR_calf'
 11: 'FR_foot'
 12: 'RL_hip'
 13: 'RL_thigh_shoulder'
 14: 'RL_thigh'
 15: 'RL_calf'
 16: 'RL_foot'
 17: 'RR_hip'
 18: 'RR_thigh_shoulder'
 19: 'RR_thigh'
 20: 'RR_calf'
 21: 'RR_foot'
 22: 'imu_link'
Joints:
  0: 'floating_base' (Fixed)
  1: 'FL_hip_joint' (Revolute)
  2: 'FL_hip_fixed' (Fixed)
  3: 'FL_thigh_joint' (Revolute)
  4: 'FL_calf_joint' (Revolute)
  5: 'FL_foot_fixed' (Fixed)
  6: 'FR_hip_joint' (Revolute)
  7: 'FR_hip_fixed' (Fixed)
  8: 'FR_thigh_joint' (Revolute)
  9: 'FR_calf_joint' (Revolute)
 10: 'FR_foot_fixed' (Fixed)
 11: 'RL_hip_joint' (Revolute)
 12: 'RL_hip_fixed' (Fixed)
 13: 'RL_thigh_joint' (Revolute)
 14: 'RL_calf_joint' (Revolute)
 15: 'RL_foot_fixed' (Fixed)
 16: 'RR_hip_joint' (Revolute)
 17: 'RR_hip_fixed' (Fixed)
 18: 'RR_thigh_joint' (Revolute)
 19: 'RR_calf_joint' (Revolute)
 20: 'RR_foot_fixed' (Fixed)
 21: 'imu_joint' (Fixed)
DOFs:
  0: 'FL_hip_joint' (Rotation)
  1: 'FL_thigh_joint' (Rotation)
  2: 'FL_calf_joint' (Rotation)
  3: 'FR_hip_joint' (Rotation)
  4: 'FR_thigh_joint' (Rotation)
  5: 'FR_calf_joint' (Rotation)
  6: 'RL_hip_joint' (Rotation)
  7: 'RL_thigh_joint' (Rotation)
  8: 'RL_calf_joint' (Rotation)
  9: 'RR_hip_joint' (Rotation)
 10: 'RR_thigh_joint' (Rotation)
 11: 'RR_calf_joint' (Rotation)
1 Like

I made code like this and a1 doesn’t appear when ‘fix_base_link = False’
except URDF problem.
I think there are some bugs in Isaac Gym.

from isaacgym import gymapi, gymutil, gymtorch
from math import sqrt, pi
import os 

os.chdir("/home/minwoo/IsaacGym_Preview_3_Package/isaacgym/legged_gym/resources/robots")
# currentPath = os.getcwd()
# print("\ncurrentPath : {}\n".format(currentPath))


class AssetDesc:
    def __init__(self, file_name, flip_visual_attachments=False,rotation=False):
        self.file_name = file_name
        self.flip_visual_attachments = flip_visual_attachments
        self.rotation = rotation

asset_descriptors = [
    AssetDesc("a1/urdf/a1.urdf", True),
    AssetDesc("Quadruped_1/urdf/Quadruped_1.urdf", False)
]

#1. initialize gym
gym = gymapi.acquire_gym()

# parse arguments
args = gymutil.parse_arguments(description="Joint control Methods Example")

#2. create a simulator
sim_params = gymapi.SimParams()
sim_params.substeps = 2
sim_params.dt = 1.0 / 60.0
sim_params.gravity = gymapi.Vec3(0, -9.8, 0)

sim_params.physx.solver_type = 1
sim_params.physx.num_position_iterations = 4
sim_params.physx.num_velocity_iterations = 1

sim_params.physx.num_threads = args.num_threads
sim_params.physx.use_gpu = args.use_gpu

sim_params.use_gpu_pipeline = False
if args.use_gpu_pipeline:
    print("WARNING: Forcing CPU pipeline.")

sim = gym.create_sim(args.compute_device_id, args.graphics_device_id, args.physics_engine, sim_params)

if sim is None:
    print("*** Failed to create sim")
    quit()

#8. create viewer using the default camera properties
viewer = gym.create_viewer(sim, gymapi.CameraProperties())
if viewer is None:
    raise ValueError('*** Failed to create viewer')

#3. add ground plane
plane_params = gymapi.PlaneParams()
gym.add_ground(sim, gymapi.PlaneParams())

#4. Loading Assets
    # add cartpole urdf asset
asset_root = "/home/minwoo/IsaacGym_Preview_3_Package/isaacgym/legged_gym/resources/robots/"
assets     = []
for asset_desc in asset_descriptors:
    asset_file = asset_desc.file_name

    asset_options = gymapi.AssetOptions()
    asset_options.fix_base_link = False
    asset_options.flip_visual_attachments = asset_desc.flip_visual_attachments
    asset_options.use_mesh_materials = True

    print(f"Loading asset {asset_file} from {asset_root}")
    assets.append(gym.load_asset(sim, asset_root, asset_file, asset_options))

#5. Environments and Actors
    # set up the env grid
num_envs = 4
spacing = 2
env_lower = gymapi.Vec3(-spacing, 0.0, -spacing)
env_upper = gymapi.Vec3(spacing, 0.0, spacing)

# cache useful handles
envs = []
actor_handles = []
scale = 7
root2s = sqrt(2)**-1
for i, asset in enumerate(assets):
    # create env
    env = gym.create_env(sim, env_lower, env_upper, 1)
    envs.append(env)

    # add actor
    pose = gymapi.Transform()
    pose.p = gymapi.Vec3(0.0, 2, 0.0)
    if i == 0 : 
        pose.r = gymapi.Quat(-root2s,0,0,root2s)
    elif i == 1 : 
        pose.r = gymapi.Quat.from_euler_zyx(0,pi/2,pi/2)

    actor_handle = gym.create_actor(env,asset,pose, "actor", i ,1)
    actor_handles.append(actor_handle)

    gym.set_actor_scale(env, actor_handle, scale)

# Configure DOF properties
# props = gym.get_actor_dof_properties(env0, cartpole0)
# props["driveMode"] = (gymapi.DOF_MODE_POS, gymapi.DOF_MODE_POS, gymapi.DOF_MODE_POS, gymapi.DOF_MODE_POS)
# props["stiffness"] = (5000.0, 5000.0, 5000.0, 5000.0)
# props["damping"] = (100.0, 100.0, 100.0, 100.0)
# gym.set_actor_dof_properties(env0, cartpole0, props)

#5. Look at the first env [Envs and Actors]
cam_pos = gymapi.Vec3(8, 4, 1.5)
cam_target = gymapi.Vec3(0, 2, 1.5)
gym.viewer_camera_look_at(viewer, None, cam_pos, cam_target)

#9. Tensor API Commanders
gym.prepare_sim(sim)

# Simulate
while not gym.query_viewer_has_closed(viewer):

    # step the physics
    gym.simulate(sim)
    gym.fetch_results(sim, True)

    # update the viewer
    gym.step_graphics(sim)
    gym.draw_viewer(viewer, sim, True)
    gym.refresh_rigid_body_state_tensor(sim)                             # need to update the state tensors
    gym.refresh_jacobian_tensors(sim)                                    # need to update the state tensors
    gym.refresh_mass_matrix_tensors(sim)                                 # need to update the state tensors

    # Nothing to be done for env 0

    # Nothing to be done for env 1

    # # Update env 2: reverse cart target velocity when bounds reached
    # pos = gym.get_dof_position(env2, cart_dof_handle2)
    # if pos >= 0.5:
    #     gym.set_dof_target_velocity(env2, cart_dof_handle2, -1.0)
    # elif pos <= -0.5:
    #     gym.set_dof_target_velocity(env2, cart_dof_handle2, 1.0)

    # # Update env 3: apply an effort to the pole to keep it upright
    # pos = gym.get_dof_position(env3, pole_dof_handle3)
    # gym.apply_dof_effort(env3, pole_dof_handle3, -pos * 50)

    # Wait for dt to elapse in real time.
    # This synchronizes the physics simulation with the rendering rate.
    gym.sync_frame_time(sim)

print('Done')

gym.destroy_viewer(viewer)
gym.destroy_sim(sim)

btw thanks for your reply !

I found all solutions

  1. As ‘Abi64’ said if I setting revolute joint in solidworks to URDF then they above subscript ‘*’ mark to effort & velocity.

experienced issue were

  • Only base_link part show on the simulation
  • Nothing will appear
    image

  1. If you have empty <link> part, then it’ll not show on the simulation.
    here is my example urdf file.

  1. Must need Inertial part.
    if your urdfs’ inertial values are 0 then, it’ll not appear.
    After I changed inertial values, it shows up correctly

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.