GithubHelp home page GithubHelp logo

kaiaai / kaiaai_simulations Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 11.62 MB

Kaia.ai pet robots ROS2 simulations package

Home Page: https://kaia.ai

License: Apache License 2.0

CMake 12.36% C++ 44.38% Python 40.83% Shell 2.42%
gazebo gazebo-ros gazebo-simulation gazebo-simulator kaia-ai remake-ai robot-framework robotics robots ros-navigation

kaiaai_simulations's Introduction

Kaia.ai pet robot simulation

Kaia.ai is a platform for 3D-printable pet robots. Please sign up for an early launch invite here.

This repo is a ROS2 simulations meta-package for Kaia.ai pet robots.

Questions? Please visit the Support Forum!

Your PC setup

  • If you are using a Windows PC, install Windows WSL 2 and Docker Desktop for Windows
  • When running in Docker for Windows, also install VcXsrv to display GUI from the container - Rviz2, Gazebo, rqt, etc.
    • Launch c:\Program Files\VcXsrv\xlaunch.exe and set its display number to zero when prompted.
  • When using a Linux PC, install Docker Engine or Docker Desktop (with GUI)
  • Download the Kaia.ai developer's Docker image docker pull kaiaai/kaiaai-ros-dev:humble

Launch the development Docker image

Open a Linux or Windows shell and run:

docker run --name kaiaai-ros-dev-humble -it -p 8888:8888/udp -e DISPLAY=host.docker.internal:0.0 -e LIBGL_ALWAYS_INDIRECT=0 kaiaai/kaiaai-ros-dev:humble

This command above launches the Kaia.ai developer Docker image and gives you bash prompt.

Simulate the default robot model

  • Run each command below in a separate terminal window
  • Optionaly, set the world to be launched using the world argument, e.g. world:=empty_world.world. kaiaai_world.world launches by default
  • Keep in mind that launching the Gazebo simulator for the very first time can take a minute or two - please be patient
ros2 launch kaiaai_gazebo world.launch.py
ros2 run kaiaai_teleop teleop_keyboard
ros2 launch kaiaai_gazebo self_drive_gazebo.launch.py
ros2 launch kaiaai_bringup rviz2.launch.py
  • world.launch.py launches Gazebo simulator populated with a world an instance of your bot
  • teleop_keyboard lets you drive the bot manually
  • self_drive_gazebo makes the bot self-drive around in Gazebo simulations
  • rviz2.launch.py launches Rviz viewer. You will need Rviz viewer for navigation (see below) to manually set the bot's initial position estimate as well as specify navigation goals, i.e. where you want your bot to move

Press CTRL-C one or more times in each terminal window to stop the simulation.

To open a new terminal window, launch a new a Linux or Windows shell (outside Docker) and run:

docker exec -it kaiaai-ros-dev-humble bash

Simulate a different robot model

  • Select the robot model you would like to simulate by setting description to the robot description package name, e.g. description:=awesome_droid. This is useful if you are modding an existing robot model
  • If the description argument is omitted, the value of KAIAAI_ROBOT environment variable will be used. If that environment variable is not set, description will default to makerspet_snoopy
ros2 launch kaiaai_gazebo world.launch.py description:=awesome_droid
ros2 run kaiaai_teleop teleop_keyboard
ros2 launch kaiaai_gazebo self_drive_gazebo.launch.py description:=awesome_droid
ros2 launch kaiaai_bringup rviz2.launch.py description:=awesome_droid

Run SLAM, generate a map

Run each command below in a separate terminal window.

ros2 launch kaiaai_gazebo world.launch.py
ros2 launch kaiaai_cartographer cartographer.launch.py use_sim_time:=true
ros2 launch kaiaai_gazebo self_drive_gazebo.launch.py
ros2 run nav2_map_server map_saver_cli -f $HOME/my_map
  • cartographer.launch.py launches the SLAM package and starts generating a map. You can see the map gradually appearing in Rviz viewer.
  • run map_saver_cli to save the map after the bot has driven around long enough to thoroughly map the world.

Press CTRL-C one or more times in each terminal window to stop the simulation.

Navigate to a goal

ros2 launch kaiaai_gazebo world.launch.py
ros2 launch kaiaai_navigation navigation.launch.py use_sim_time:=true map:=$HOME/my_map.yaml
  • navigation.launch.py launches the navigation package and loads the map you created in the previous step
  • Before your bot can navigate, i.e. self-drive itself, to a destination of your choice, you must manually specify the approximate initial location of your bot.
    • Click the 2D Pose Estimate button on the upper toolbar in Rviz
    • Click on the map at the location where your bot currently is. Hold your mouse button down and drag your mouse in the direction your bot is facing. Now you can release your mouse button. Rviz should show your bot's location on the map.
  • Specify where you would like your bot to navigate, i.e. the goal location
    • Click the Nav2 Goal button on the upper toolbar in Rviz
    • Clock on the map at the navigation goal location. Hold your mouse button down and drag your mouse in the direction you want your bot to face once it arrives to its goal location. Now you can release your mouse button. Rviz should display your bot's planned path and your bot should start moving.

Press CTRL-C one or more times in each terminal window to stop the simulation.

Acknowledgements

Initial versions of packages in this repo are based on ROBOTIS Turtlebot3 code

kaiaai_simulations's People

Contributors

kaiaai avatar makerspet avatar remakeai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.