Skip to content

A self-balancing robot for Isaac Sim

Notifications You must be signed in to change notification settings

alvgaona/balancio-sim

Repository files navigation

Balancio Sim

Balancio Animation

This is the implementation of a self-balancing robot called Balancio in NVIDIA Isaac Sim.

The robot is an educational robot which can be built by any student with standard hardward, firmware and software. It's extremely affordable and it opens the door to many applications with a self-balancing robot.

Pixi

The very first thing you'll need is a package manager called Pixi, it's fast and easy to use. The reason behind using Pixi is that you can get ROS2 working super quick, and it can even run ROS2 in mostly any OS, e.g., Windows, Linux or macOS. Follow this link for installation instructions.

Once you have it, make sure you're in the repo folder in your machine, and run the Pixi install command. Wait a couple of minutes until everything is fetched.

pixi install

If you want to test this, you can run the following ROS2 command.

pixi run ros2 topic list

The output should look like this:

/parameter_events
/rosout

Isaac Sim

It's a prerequisite you have Isaac Sim running on your machine without errors. You can get it using the Omniverse Launcher that you can download from here; you'll need an NVIDIA account. This example shall work either on Windows or Linux.

Assets

If you'd like to just import the robot itself in any other world you may have created, just download the USD file for Balancio only.

Now if you want the world we've created, where you can find both an NVIDIA Jetbot, and the Balancio ready to send command via ROS2, you should download this USD file. Then, you can open it directly in Isaac Sim.

Running Isaac Sim

You can spin up Isaac Sim through the Ominverse Launcher UI but ROS2 won't work directly like that, so there's a script in the scripts/ folder named isaac_sim_run.ps1 or isaac_sim_run.sh, depending if you're on Windows or Linux, respectively.

You need to run either script from within the Pixi environment, so first run:

pixi shell

And then just do either:

Windows Powershell

. .\scripts\isaac_sim_run.ps1

Linux Shell

./scripts/isaac_sim_run.sh

This will open up Isaac Sim with ROS2 ready to be used.

ROS2

If you went through the Pixi section, you should have ROS2 on your machine. So you can run the pid node in the repo to send the commands to Isaac Sim, and control Balancio.

pixi run ros2 run balancio pid --ros-args \
-p kp:=2.3 \
-p ki:=2.0 \
-p kd:=0.05 \
-p set_point:=-0.017 \
-p sum_constraint:=1.0

And in another shell, you can subscribe to the /cmd_vel topic and check that you're actually getting the commmand.

pixi run ros2 topic echo /cmd_vel