Categories
AI/ML control Locomotion simulation The Sentient Table

ARS and PPO

https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=12553

A couple of advanced data science algorithms. Implemented both for the walking table. ARS is great. We hear a lot about deep learning. This one is shallow learning, and does very well on simpler tasks. Just inputs and outputs, no hidden layers.

It’s similar to the Evolution Strategies algorithm. Generally trying some random stuff out, and slowly changing the model based on what gets you closer to the goal.

ARS: https://arxiv.org/pdf/1803.07055.pdf

Good lecture slides http://eddiesagra.com/wp-content/uploads/2019/03/Introduction-to-Machine-Learning-v1.2-Mar-11-2019.pdf

ARS – Augmented Random Search

https://github.com/colinskow/move37/blob/master/ars/ars.py

https://towardsdatascience.com/introduction-to-augmented-random-search-d8d7b55309bd

PPO – Proximal Policy Optimization

https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_envs/agents/ppo/algorithm.py

Categories
Locomotion The Sentient Table

Robot prep: URDF

After much confusion, I made a table with legs that can move.

So I raised the table to z=1 plane and put the origin of the joints in the right place. THEN you set the legs/links with origin at -0.5 because the joint is at 1, and the leg is 1 long, and presumably it needs 0.5 because that’s the centre of the box.

I did visualisation by changing the filename in this file in the bullet3 folders, and running in python:

python3 biped2d_pybullet.py

seemed better than RViz

<?xml version="1.0"?>
<robot name="table">

  <material name="white">
    <color rgba="1 1 1 1"/>
  </material>

  <material name="black">
    <color rgba="0.2 0.2 0.2 1"/>
  </material>

  <material name="blue">
    <color rgba="0 0 1 1"/>
  </material>


	
  <link name="torso">
    <visual>
      <geometry>
        <box size="2 2 0.1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 1"/>
      <material name="white"/>
    </visual>
    <collision>
      <geometry>
        <box size="2 2 0.1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 1"/>
      <contact_coefficients mu="0.08" />
    </collision>
  </link>
 


 
  <link name="r_upperleg">
    <visual>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <material name="black"/>
    </visual>
    <collision>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <contact_coefficients mu="0.08" />
    </collision>
  </link>

  
  <joint name="torso_to_rightleg" type="revolute">
    <parent link="torso"/>
    <child link="r_upperleg"/>
    <axis xyz="1 0 0"/>
    <limit effort="0.0" lower="-1.57." upper="1.57" velocity="1000.0"/>
    <origin rpy="0 0 0" xyz="1 1 1"/>
  </joint>





  
  <link name="l_upperleg">
    <visual>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <material name="black"/>
    </visual>
    <collision>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <contact_coefficients mu="0.08" />
    </collision>
  </link>

  
  <joint name="torso_to_leftleg" type="revolute">
    <parent link="torso"/>
    <child link="l_upperleg"/>
    <axis xyz="1 0 0"/>
    <limit effort="10.0" lower="-1.57." upper="1.57" velocity="1000.0"/>
    <origin rpy="0 0 0" xyz="-1 1 1"/>
  </joint>








  <link name="front_r_upperleg">
    <visual>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <material name="black"/>
    </visual>
    <collision>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <contact_coefficients mu="0.08" />
    </collision>
  </link>


  <joint name="torso_to_frontrightleg" type="revolute">
    <parent link="torso"/>
    <child link="front_r_upperleg"/>
    <axis xyz="1 0 0"/>
    <limit effort="0.0" lower="-1.57." upper="1.57" velocity="1000.0"/>
    <origin rpy="0 0 0" xyz="1 -1 1"/>
  </joint>








  <link name="front_l_upperleg">
    <visual>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <material name="black"/>
    </visual>
    <collision>
      <geometry>
        <box size="0.1 0.1 1"/>
      </geometry>
      <origin rpy="0 0 0" xyz="0 0 -0.5"/>
      <contact_coefficients mu="0.08" />
    </collision>
  </link>


  <joint name="torso_to_frontleftleg" type="revolute">
    <parent link="torso"/>
    <child link="front_l_upperleg"/>
    <axis xyz="1 0 0"/>
    <limit effort="10.0" lower="-1.57." upper="1.57" velocity="1000.0"/>
    <origin rpy="0 0 0" xyz="-1 -1 1"/>
  </joint>

  

</robot>