Simple 2-body URDF fails to load in pyBullet

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
joehays
Posts: 2
Joined: Thu Sep 17, 2020 9:03 pm

Simple 2-body URDF fails to load in pyBullet

Post by joehays »

I'm new to pyBullet. I have a simple 2 body URDF that passes the "check_urdf" test. It also has the expected "urdf_to_graphiz" output. However, when I run a simple python script to load it pyBullet fails to load the URDF.

Code: Select all

(pyBullet) :$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal
(pyBullet) :$ uname -aLinux SEDACS29L 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
I'm running pyBullet 3.0.1.

My simple script is,

Code: Select all

import pybullet as p
import pybullet_data as pd

p.connect(p.GUI)
p.setAdditionalSearchPath(pd.getDataPath())
plane = p.loadURDF("plane.urdf")
urdf = p.loadURDF("test.urdf",[0,0,1.0],  useFixedBase=False
The output of running this script is,

Code: Select all

(pyBullet) :$ python test_load_urdf.py 
pybullet build time: Sep 14 2020 02:24:09
startThreads creating 1 threads.
starting thread 0
started thread 0 
argc=2
argv[0] = --unused
argv[1] = --start_demo_name=Physics Server
ExampleBrowserThreadFunc started
X11 functions dynamically loaded using dlopen/dlsym OK!
X11 functions dynamically loaded using dlopen/dlsym OK!
Creating context
Created GL 3.3 context
Direct GLX rendering context obtained
Making context current
GL_VENDOR=VMware, Inc.
GL_RENDERER=llvmpipe (LLVM 10.0.0, 256 bits)
GL_VERSION=3.3 (Core Profile) Mesa 20.0.8
GL_SHADING_LANGUAGE_VERSION=3.30
pthread_getconcurrency()=0
Version = 3.3 (Core Profile) Mesa 20.0.8
Vendor = VMware, Inc.
Renderer = llvmpipe (LLVM 10.0.0, 256 bits)
b3Printf: Selected demo: Physics Server
startThreads creating 1 threads.
starting thread 0
started thread 0 
MotionThreadFunc thread started
ven = VMware, Inc.
ven = VMware, Inc.
numActiveThreads = 0
stopping threads
Thread with taskId 0 exiting
Thread TERMINATED
destroy semaphore
semaphore destroyed
destroy main semaphore
main semaphore destroyed
finished
numActiveThreads = 0
btShutDownExampleBrowser stopping threads
Thread with taskId 0 exiting
Thread TERMINATED
destroy semaphore
semaphore destroyed
destroy main semaphore
main semaphore destroyed
I'm completely stumped. The URDF is very simple.

Code: Select all

<?xml version="1.0" ?>
<robot name="simpleManip">
  <link name="base">
   <inertial>
      <mass value="17.9"/>
      <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
    </inertial>
  </link>
  <link name="link0">
    <inertial>
      <mass value="1.975"/>
      <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
    </inertial>
  </link>
  <joint name="jnt0" type="revolute">
    <parent link="base"/>
    <child link="link0"/>
    <axis xyz="1 0 0"/>
    <origin xyz="0.308 0.0955 0"/>
    <limit effort="375" lower="-0.53" upper="0.53" velocity="8.6"/>
    <dynamics damping="0.0" friction="0.0"/>
  </joint>
</robot>
What am I missing here?
jwhitman
Posts: 4
Joined: Fri Sep 25, 2020 1:49 pm

Re: Simple 2-body URDF fails to load in pyBullet

Post by jwhitman »

I am able to load the urdf, but since there are no visual elements to the links, nothing appears in the gui.
Your script works for me but since there is no main loop, it initializes the gui, loads the robot, then exits. When I add a while loop, it leaves the GUI open, and looks ok
Post Reply