Skip to content

MAVROS mocker to allow controlling a minecraft bot using mavros esc commands

License

Notifications You must be signed in to change notification settings

AscendNTNU/mineros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MineROS relase 1.0 documentation

MineROS allows the user to fully control a MC bot using ROS services and topics, The current version of MineROS is made for ROS2 Humble and is still in development. The purpose of this project is to give a conducive learning environment for people who want to learn ROS2 and python. Specifically for people who want to learn mavros, as this is what the project attempts to mock.

Dependencies

  • ROS2 Humble
  • Python3
  • Nodejs version >= 20
  • Mineflayer Api
  • Minecraft version = 1.20

Installation

Install correct minecraft version

In the minecraft launcher

Minecraft install step 1 Minecraft install step 2 Minecraft install step 3

Clone repo

git clone [email protected]:AscendNTNU/mineros.git --recursive

All commands should be run from the root of this repo.

Install nodejs

Check if node is already installed

node -v

If it is below v20, remove it:

sudp apt remove nodejs --autoremove

Then install the correct version

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Verify correct version:
node -v   # should show v20.x
npm -v    # should be avove 9.0

Install npm packages

cd src/mineros-js
npm install mineflayer-collectblock rclnodejs

Building the MineROS bot

  1. Generate the javascript ROS message interface
npx generate-ros-messages
cd ..
  1. Build the ROS packages:
colcon build --symlink-install
# When developing, symlink makes it so we don't need to build every time we change a file.
# This does not apply to C++ files as they need to be compiled

Running

Make sure a minecraft server is running on localhost:25565 Source the workspace:

source install/setup.sh

Then launch the mineros bot

ros2 launch mineros-js bot.launch.py

Then launch your own script to control the bot. For example, in a new shell run:

source install/setup.sh
ros2 launch my_first_package main.launch.py

The my_first_package is where you'll be creating your ROS nodes. See the README.


API doc

Following is general api information and links to api docs.

Minecraft data

IMPORTANT: BLOCKS DO NOT HAVE THE SAME IDS AS ITEMS

Block ids

Several of the services and topics require knowledge of the minecraft block ids, this can be found here REMEBER TO SELECT THE CORRECT MINECRAFT VERSION: 1.20 http://prismarinejs.github.io/minecraft-data/?d=blocks

Item ids

on the boot up of the MineROS system all item ids are written to the file docs/items.txt. Note that blocks dont have the same id as items

Links to API docs

About

MAVROS mocker to allow controlling a minecraft bot using mavros esc commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5