How does the basePosition argument in loadURDF() work?

Post Reply
bolundai
Posts: 1
Joined: Tue May 11, 2021 4:12 pm

How does the basePosition argument in loadURDF() work?

Post by bolundai »

I am new to pybullet and URDFs, so I am just playing around and get a feel of what each function does. I created a simple URDF file of a box:

Code: Select all

<robot name="box">
    <link name="base_link">
        <visual> 
            <geometry> 
                <box size="1.0 1.0 1.0"/>
            </geometry>
            <origin xyz="0.0 0.0 0.0"/>
        </visual>
        <collision>
            <geometry> 
                <box size="1.0 1.0 1.0"/>
            </geometry>
            <origin xyz="0.0 0.0 0.0"/>
        </collision>
    </link>
</robot>
and loaded it using

Code: Select all

p.loadURDF("box.urdf", basePosition=[0.0, 0.0, 2.0])
what I saw was the box started at [0, 0, 2] and started to fall until it collides with the ground. If so what is the purpose of setting this basePosition? I get it why you would like to change the basePosition along x and y but what is the purpose of the basePosition z?
Post Reply