Code Monkey home page Code Monkey logo

free_fleet's Introduction

Free Fleet

Contents



About

Welcome to free_fleet, an open-source robot fleet management system. Sometimes it is called the "Fun Free Fleet For Friends" (F5).

Note, this repository is under active development. Things will be quite unstable for a while. Please open an issue ticket on this repo if you have problems. Cheers.



Installation Instructions

Prerequisites

Install all non-ROS prerequisite packages,

sudo apt update && sudo apt install \
  git cmake wget \
  python3-vcstool \
  python-catkin-tools \
  libyaml-cpp-dev

Install all ROS prerequisite packages,

sudo apt install \
  ros-melodic-move-base-msgs \
  ros-melodic-tf2 \
  ros-melodic-tf2-ros \
  ros-melodic-tf2-geometry-msgs \
  ros-melodic-actionlib \
  ros-melodic-sensor-msgs

Message Generation

Message generation via FreeFleet.idl is done using dds_idlc from CycloneDDS. For convenience, the generated mesasges and files has been done offline and committed into the code base. They can be found here.

To recreate them, a full installtion of CycloneDDS will be needed, which will require additional prerequisites. The full instructions can be found on its repository.

./dds_idlc -allstructs FreeFleet.idl

Client in ROS 1

Start a new ROS 1 workspace, and pull in the necessary repositories,

mkdir -p ~/client_ws/src
cd ~/client_ws

# set up the ROS 1 workspace free_fleet
wget https://raw.githubusercontent.com/osrf/free_fleet/master/free_fleet_ros1.repos
vcs import src < free_fleet_ros1.repos

Source ROS 1 and build with the cmake flag that minimizes the build of CycloneDDS,

cd ~/client_ws
source /opt/ros/melodic/setup.bash

# build cyclonedds first with the necessary cmake flags
catkin build cyclonedds --cmake-args -DBUILD_IDLC=NO

# build the rest of the packages
catkin build

Server in ROS 2

Start a new ROS 2 workspace, and pull in the necessary repositories,

mkdir -p ~/server_ws/src
cd ~/server_ws

# set up the ROS 2 workspace for free_fleet
wget https://raw.githubusercontent.com/osrf/free_fleet/master/free_fleet_ros2.repos
vcs import src < free_fleet_ros2.repos

Source ROS 2 and build with the cmake flag that minimizes the build of CycloneDDS,

cd ~/server_ws
source /opt/ros/eloquent/setup.bash

# build cyclonedds first with the necessary cmake flags
colcon build --packages-select cyclonedds --cmake-args -DBUILD_IDLC=NO

# build the rest of the packages
colcon build


Examples

Barebones Example

This example emulates a running robot and also a running free fleet server,

source ~/client_ws/devel/setup.bash
roslaunch free_fleet_examples_ros1 fake_client.launch

The client will then start subscribing to all the necessary topics, and start publishing robot states over DDS to the server. Start the server using

source ~/server_ws/install/setup.bash
ros2 launch free_fleet_examples_ros2 fake_server.launch.xml

To verify that the fake client has been registered, there will be print-outs on the server terminal, otherwise, the ROS 2 messages over the /fleet_states topic can also be used to verify,

source ~/server_ws/install/setup.bash
ros2 topic echo /fleet_states

Next, to send requests and commands, check out the example scripts and their uses here.


Turtlebot3 Simulation

This example launches a single Turtlebot3 in simulation, and registers it as a robot within a fleet controlled by free_fleet. To set up this simulation example, more ROS 1 packages will be needed, assuming we already have built the initial setup listed here

cd ~/client_ws/src
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git

# source and build
cd ~/client_ws
source devel/setup.bash
catkin build

Launch the basic simulation of a single Turtlebot3, with a free fleet client attached to it, by sourcing the client workspace and launching the provided example launch file,

source ~/client_ws/devel/setup.bash
export TURTLEBOT3_MODEL=waffle && roslaunch free_fleet_examples_ros1 turtlebot3_world_ff.launch

This launch file starts the simulation in gazebo, visualization in rviz, as well as the simulated navigation stack of the single turtlebot3. Once the simulation and visualization show up, the robot can be commanded as per normal through rviz with 2D Nav Goal.

Now, we start the free fleet server, with the provided launch file,

source ~/server_ws/install/setup.bash
ros2 launch free_fleet_examples_ros2 turtlebot3_world_ff.launch.xml

At this point, the server should have registered the client running on that single simulated robot and a print-out should appear in the server terminal. Another way to check, is to listen in on the /fleet_states topic, using ros2 topic echo /fleet_states.

Next, to send requests and commands, check out the example scripts and their uses here.


Multi Turtlebot3 Simulation

This example launches three Turtlebot3s in simulation, and registers each robot as a client within a fleet controlled by free_fleet. The setup of this simulation is the same as the single turtlebot3 simulation example.

Similarly to the example above, launch the provided launch file, which will start the simulation, visualization, navigation stacks of 3 turtlebot3s, and free fleet clients for each of the robots,

source ~/client_ws/devel/setup.bash
export TURTLEBOT3_MODEL=waffle && roslaunch free_fleet_examples_ros1 multi_turtlebot3_ff.launch

Once the simulation shows up and the free fleet clients are alive, we launch the free fleet server just like the example above,

source ~/server_ws/install/setup.bash
ros2 launch free_fleet_examples_ros2 turtlebot3_world_ff.launch.xml

Note how we are using the exact same launch script as above, this is because all the turtlebot3s in the simulation are registered under the same fleet, identified by the fleet_name, which in this case is turtlebot3.

At this point, the server should have registered the client running on the 3 simulated robots and print-outs should appear in the server terminal. Another way to check, is to listen in on the /fleet_states topic, using ros2 topic echo /fleet_states.

Next, to send requests and commands, check out the example scripts and their uses here.


Commands and Requests

Now the fun begins! There are 3 types of commands/requests that can be sent to the simulated robots through free_fleet,

Destination requests, which allows single destination commands for the robots,

ros2 run free_fleet_examples_ros2 send_destination_request.py -f FLEET_NAME -r ROBOT_NAME -x 1.725 -y -0.39 --yaw 0.0 -l B1 -i UNIQUE_TASK_ID -t destination_requests

Path requests, which requests that the robot perform a string of destination commands,

ros2 run free_fleet_examples_ros2 send_path_request.py -f FLEET_NAME -r ROBOT_NAME -i UNIQUE_TASK_ID -p '[{"x": 1.725, "y": -0.39, "yaw": 0.0, "level_name": "B1"}, {"x": 1.737, "y": 0.951, "yaw": 1.57, "level_name": "B1"}, {"x": -0.616, "y": 1.852, "yaw": 3.14, "level_name": "B1"}, {"x": -0.626, "y": -1.972, "yaw": 4.71, "level_name": "B1"}]'

Mode requests which only supports pause and resume at the moment,

ros2 run free_fleet_examples_ros2 send_mode_request.py -f FLEET_NAME -r ROBOT_NAME -m pause -i UNIQUE_TASK_ID
ros2 run free_fleet_examples_ros2 send_mode_request.py -f FLEET_NAME -r ROBOT_NAME -m resume -i UNIQUE_TASK_ID

Note that the task IDs need to be unique, if a request is sent using a previously used task ID, the request will be ignored by the free fleet clients.



Notes

Client in ROS 1

  • the time of the state is tied to the transform, if no transform is found no state will be published over DDS

  • battery percentages is derived from sensor_msgs/BatteryState

  • robot mode is derived from a combination of battery states and robot motion

  • level name is currently derived from a simple std_msgs/String, and at the moment is not used in any core components or decision making



Plans

  • Basic Qt UI for sending the requests listed here

  • Server User Interface - in order to monitor and control the entire fleet of robots without running scripts all the time.

  • Refactor more client and server functionalities into free_fleet, rather than having them in free_fleet_client_ros1 and free_fleet_server_ros2

  • Correctly identify and work with level names

  • Documentation!

  • Integration demonstrations with rmf_core

free_fleet's People

Contributors

aaronchongth avatar codebot avatar

Watchers

 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.