gazebo-classic
Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
Top Related Projects
Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Webots Robot Simulator
Quick Overview
Gazebo Classic is an open-source 3D robotics simulator that allows users to design, test, and simulate robots in complex indoor and outdoor environments. It provides a robust physics engine, high-quality graphics, and programmatic interfaces for robot control, making it a valuable tool for robotics research and development.
Pros
- Powerful physics simulation with support for various environments and conditions
- Extensive library of robot models and sensors for quick prototyping
- Integration with ROS (Robot Operating System) for seamless robot development
- Active community and extensive documentation for support and learning
Cons
- Steep learning curve for beginners in robotics simulation
- Can be resource-intensive, requiring powerful hardware for complex simulations
- Limited real-time performance in highly complex scenarios
- Some users report occasional stability issues with large-scale simulations
Code Examples
- Creating a simple world with a ground plane and a box:
<?xml version="1.0"?>
<sdf version="1.6">
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<model name="box">
<pose>0 0 0.5 0 0 0</pose>
<link name="link">
<collision name="collision">
<geometry>
<box>
<size>1 1 1</size>
</box>
</geometry>
</collision>
<visual name="visual">
<geometry>
<box>
<size>1 1 1</size>
</box>
</geometry>
</visual>
</link>
</model>
</world>
</sdf>
- Controlling a robot using the Gazebo API (C++):
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
gazebo::physics::ModelPtr model;
gazebo::event::ConnectionPtr updateConnection;
void OnUpdate()
{
// Move the robot forward
model->SetLinearVel(ignition::math::Vector3d(1, 0, 0));
}
void Load(gazebo::physics::WorldPtr _world, sdf::ElementPtr _sdf)
{
model = _world->ModelByName("robot_model_name");
updateConnection = gazebo::event::Events::ConnectWorldUpdateBegin(
std::bind(&OnUpdate));
}
- Creating a custom Gazebo plugin (C++):
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
namespace gazebo
{
class MyPlugin : public ModelPlugin
{
public: void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
{
// Plugin initialization code
}
// Declare any necessary member variables
};
GZ_REGISTER_MODEL_PLUGIN(MyPlugin)
}
Getting Started
-
Install Gazebo Classic:
sudo apt-get install gazebo11
-
Create a simple world file (e.g.,
my_world.world
) using the XML example provided above. -
Launch Gazebo with your custom world:
gazebo my_world.world
-
Explore the Gazebo GUI and start building your simulation environment.
Competitor Comparisons
Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
Pros of gazebo-classic
- Well-established and mature simulation platform
- Extensive documentation and community support
- Wide range of plugins and models available
Cons of gazebo-classic
- Older codebase with potential legacy issues
- Limited integration with modern robotics frameworks
- Performance limitations with complex simulations
Code comparison
gazebo-classic:
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
namespace gazebo
{
class MyPlugin : public WorldPlugin
{
public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
{
// Plugin implementation
}
};
GZ_REGISTER_WORLD_PLUGIN(MyPlugin)
}
gazebo-classic:
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>
namespace gazebo
{
class MyPlugin : public WorldPlugin
{
public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
{
// Plugin implementation
}
};
GZ_REGISTER_WORLD_PLUGIN(MyPlugin)
}
Note: The code comparison shows identical structure as both repositories refer to the same project, gazebo-classic.
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Pros of Bullet3
- Lightweight and efficient physics simulation library
- Supports a wide range of platforms and programming languages
- Highly customizable and extensible for specific use cases
Cons of Bullet3
- Less integrated with robotics-specific tools and frameworks
- Smaller community and ecosystem compared to Gazebo Classic
- Requires more manual setup for complex robotic simulations
Code Comparison
Bullet3:
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
btBroadphaseInterface* overlappingPairCache = new btDbvtBroadphase();
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
btDiscreteDynamicsWorld* dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfiguration);
Gazebo Classic:
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<physics type="ode">
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
</world>
Bullet3 requires more manual setup in C++, while Gazebo Classic uses XML-based world descriptions for easier configuration.
Webots Robot Simulator
Pros of Webots
- Cross-platform compatibility (Windows, macOS, Linux)
- Web-based interface for easy access and collaboration
- Extensive library of pre-built robot models and environments
Cons of Webots
- Steeper learning curve for beginners
- Less extensive documentation compared to Gazebo Classic
- Smaller community and fewer third-party plugins
Code Comparison
Webots (Python):
from controller import Robot
robot = Robot()
timestep = int(robot.getBasicTimeStep())
while robot.step(timestep) != -1:
# Main control loop
Gazebo Classic (C++):
#include <gazebo/gazebo.hh>
namespace gazebo {
class MyPlugin : public ModelPlugin {
public: void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) {
// Plugin initialization
}
};
GZ_REGISTER_MODEL_PLUGIN(MyPlugin)
}
Both simulators offer powerful features for robotics simulation, but Webots excels in cross-platform support and web-based accessibility, while Gazebo Classic has a larger community and more extensive documentation. The choice between them depends on specific project requirements and user preferences.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Gazebo - A dynamic multi-robot simulator
[!NOTE] A new version of Gazebo (formerly known as Ignition) is now available. Please visit https://gazebosim.org or https://github.com/gazebosim/gz-sim to learn more.
[!WARNING]
Gazebo Classic will reach End-Of-Life in January 2025. Users are highly encouraged to migrate to the new Gazebo using our migration guides
This is the Gazebo Classic simulator. Gazebo simulates multiple robots in a 3D environment, with extensive dynamic interaction between objects.
Documentation
Get started at
Top Related Projects
Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Webots Robot Simulator
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot