Skip to content
MostafaH04Public

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

ย 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Robot Dog

Welcome to the Robot Dog project! This repository contains the codebase for controlling a custom-built robot dog designed for autonomous indoor navigation. Our primary development focus is under robot_ws, which involves creating ROS2 packages for operating the robot dog.

While the physical robot dog exists, we are currently developing a virtual model to test control algorithms and methodologies before deploying them on the real robot. In parallel, we're designing a custom controller board featuring a powerful STM32 MCU, an IMU, and more.

Table of Contents

Running the Robot Simulation Locally

Detailed instructions coming soon!

Software Progress

Simulation

To faciltate software development without risking damage to the robot dog we decided to attempt to simulate the physical robot to some degree to de-risk development and make it faster + easier.

Matplotlib Model

To begin, an effort was made to create a simple stick figure like model of the robot dog to facilitate developing the IK for individual legs before testing on the physical dog. This model was directly based on measurements from the dog assembly (in Fusion360) and offered a "quick and dirty" way to verify that the IK looks about right.

As this model was developed further and the lower level firmware for joint control was established, we began to test and verify this stick figure model along with the IK. These tests involved commanding certain leg joint commands and comparing the resulting final leg configuration in real life and the Matplotlib model. These tests allowed us to uncover obvious mistakes in the IK model and iterate on it until it was fixed.

image

The model was expanded to involve the full robot body and was used to visualize simple gait sequences genearted using time sinusoidal functions mapped to the x and z positions of the ends of each leg. This led us to getting a video of the dog taking its first steps ๐ŸŽ‰!

ezgif-7-b41cf989ee
Clumsy... but we all start somewhere ๐Ÿ˜….

Gazebo + ROS2

To simplify development and ensure modularity between simulation + testing and physical robot we wanted to use the ROS framework for development, specifically ROS2 (Humble). We found that commonly the general public seems to use gazebo for ROS2 related projects and thus decided to try it out hoping that there would be enough documentation and support out there (foreshadowing ๐Ÿฅฒ).

The problem began with having to generate URDF model based on our robot dog. Since our robot was fully designed in Fusion360 we were able to use an open source conversion tool (Fusion2URDF). However, we ran into a major issue. Due to URDF's tree structure (enforcing a single parent per link) and since our robot used a closed chain design for the leg, we had to find a work-around. After much research, we found that it would be possible to create essentially generate a URDF model with the leg kinematic chain open then close it using custom software. This was the ideal case as we wanted to be able to check for collisions across the entire leg assembly as well as maintain the dynamic properties as much as possible. However, this solution would have involved a lot of work to retrieve the correct relative transforms in fusion (numbers were not very nice), so we decided to proceed with an initial simplified open chain model for the legs and create a mapper in software that uses the FK of the leg servo joint angles to command the simulated leg joint angles. We still aim to revist using the open chain model and closing it in softwar in the future as that would provide a better representation of the physical system.

image (1)
Our closed chain 3DOF leg assembly.

image
Open chain robot dog assembly to be closed in software.

image
Simplified robot dog assembly (in use)

With the URDF model we were able to begin using gazebo for a physics based simulation of our robot dog. After hours of debugging, tuning parameters and correcting the inertia tensors we were able to get the robot standing in gazebo. The next step was controlling the dog. For this step we opted for ros2-control as we had seen demonstrations of quadrupeds using ros-control (using ROS1), but we were very wrong ๐Ÿ’€.

After more hours trying to control the robot using different built-in controllers for ros2-control, turns out, ROS2 control doesn't seem to behave nicely for legged robots (skids and builds up acceleration)... Who would have thought...

Left with either writing our own controller for the dog in gazebo, which probably would have been to bad looking back at this, but we had finals coming up in just a few weeks at this point and we just wanted to get this done (Calc 3 is not it btw...). Soooo, we decided to redo everything and write our own physics engine from scratch!!!

This-is-Fine-300x300

Just kidding. We just decided to use PyBullet instead. It was mainly just much easier to get setup with our URDF model.

PyBullet

PyBullet is pretty straightforward and easy to use which made it really easy to just setup a ROS2 node that spins up a PyBullet instance with a simple world and the dog along with subscribers and publishers for the joint commands and the robot's state.

At this point we were able to setup launch files and visualization in rviz/foxglove (either is possible currently using foxglove... just felt like it lol...).

Then we just setup a quick control node that carries out IK and FK to determine the URDF model's joint angles based on the servo commanded joint angles to mimic the physical hardware interface as much as possible.

Now we can just test control related work atm and working on getting a few virtual sensors in place starting with IMUs to begin working on the localization and navigation stack.

27d

Controls

Really the goals for this project in terms of control is somewhat limitless (not considering that we are eng students and are too broke to use top of the line hardware). We can really go super simple with pre-defined gait sequences or even close loop stabilized gait sequences, or really push our limits and try to implement some cool paper proposing some hybrid MPC + RL approach. Overall, the main goal for controls is to make the software interface modular enough to allow for any sort of control. Which should be ideally fullfilled by our use of ROS2 nodes to modularize different components of the software.

Un-stablized gaits

Walk

Essentially one leg is lifted at a time while all other legs move backwards (while in contact with the ground) moving the robot forward.
ezgif-4-aa80b01d10

Trot

Diagonal legs are locked in phase and the diagonal pair of legs are out of phase by half a period. This creates an almost jogging motion for the quadruped. Really nice for speed!
ezgif-3-2344fa2f68

Hardware Progress

Mechanical Progress

Repo Maintainers

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages