Coder Social home page Coder Social logo

vip2023-2_team_skynet's Introduction

README - Webots - Obstacle avoiding robot simulation

12204505 Guliza Aitkulova

Code Overview

The code is a ROS (Robot Operating System) package that sets up a robot simulation for obstacle avoidance. It consists of several files:

  • my_robot.urdf: This file defines the robot's structure and sensors using the URDF (Unified Robot Description Format) XML format.
  • ObstacleAvoider.hpp and ObstacleAvoider.cpp: These files define a class called ObstacleAvoider that handles the obstacle avoidance logic. It subscribes to sensor data from the left and right distance sensors and publishes velocity commands to avoid obstacles.
  • CMakeLists.txt: This file contains the CMake build instructions for the package, including dependencies and installation targets.
  • robot_launch.py: This file defines the launch configuration for running the simulation. It launches the Webots simulator, the webots_ros2_driver node, and the obstacle_avoider node.

Building and Running

To build and run the code, follow these steps:

  1. Open a terminal and navigate to the ros2_ws directory.
  2. Build the package using the following command:
    colcon build --packages-select my_package
    
  3. Source the setup script to add the package to the ROS environment:
    source install/local_setup.bash
    
  4. Launch the simulation using the following command:
    ros2 launch my_package robot_launch.py
    

Additional Notes

  • Make sure you have ROS 2 and the necessary dependencies installed before building and running the code.
  • The launch file robot_launch.py assumes the presence of a world file named my_world.wbt in the worlds directory of the package. Make sure to provide the appropriate world file or modify the launch file accordingly.
  • The code assumes the presence of the webots_ros2_driver package for interfacing with the Webots simulator. Make sure to install this package before building and running the code.

Here is the output screenshots Alt text Alt text Alt text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.