Code Monkey home page Code Monkey logo

alphabot2-simulator's Introduction

Alphabot2 Ros Package and Simulator

Installation and Dependencies

  • ROS distro: ROS Kinetic

  • Ubuntu version: Ubuntu 16.04 LTS (Xenial)

  • Gazebo version: Gazebo 7.0

Perform the full installation for the ROS Kinetic that comes with Gazebo 7.0

Directory Organization

In the root of the repository, every folder represents a ROS package (except for pictures and Report, used to hold images for this Readme and source files for the report, respectively). Inside each package folder, we have the usual CMakeLists.txt and package.xml, along with a launch/ folder (if there are launch files in the package) and a src/ folder (if there is any code in the package). In some special cases (such as alphabot2_world and alphabot2_pantilt), packages may have other folders whose names will be self-explanatory for ease of use.

Building

Clone this repository into the src folder inside the catkin workspace and compile it.

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/ssscassio/alphabot2-simulator.git
cd ..
catkin_make
source devel/setup.bash
chmod +x src/alphabot2-simulator/**/*.py

Running

Simulation:

To launch the simulation world run:

roslaunch alphabot2_world spawn_world.launch

To spawn the robot inside the world run:

roslaunch alphabot2_world spawn_robot.launch

To launch the pan tilt control node run:

roslaunch alphabot2_pantilt alphabot2_pantilt_gazebo.launch

To start the bottom sensors middleman node run:

rosrun alphabot2_sensors_middleman BottomSensorsMiddleman.py

To start the top sensors middleman node run:

rosrun alphabot2_sensors_middleman TopSensorsMiddleman.py

To launch the robot movement created by the sensors node run:

roslaunch alphabot2_control gazebo_sensors_control.launch

Real Robot:

To launch the control node run:

roslaunch alphabot2_control alphabot2_control_real.launch

To launch the pan tilt control node run:

roslaunch alphabot2_pantilt alphabot2_pantilt_control_real.launch

To start the alphabot2 node to handler with top sensors, bottom sensors and drive control run:

roslaunch alphabot2_control alphabot2_robot_handler.launch

To launch the robot movement created by the sensors node run:

roslaunch alphabot2_control alphabot2_sensors_control.launch

ROS architecture

Rosgraph for the simulation world

Rosgraph for real alphabot Rosgraph for sensors and control using sensors














Description of ROS nodes

  • alphabot2_control_node_real: Subscribe to /alphabot2/control and translate it to drive control the Alphabot2. (This node only runs on a RaspberryPI)
  • alphabot2_pantilt_node_real: Subscribe to /alphabot2/vertical and /alphabot2/horizontal topics and control the Pan and Tilt position of the RaspCam on Alphabot2. (This node only runs on a RaspberryPI)
  • alphabot2_pantilt_node_gazebo: Same of alphabot2_pantilt_node_real but controls Gazebo model virtual joints instead of real robot Pan-Tilt.
  • alphabot2_top_sensors_middleman: Receives info from Gazebo top sensors and retransmits in standardized format to /alphabot2/top_sensors.
  • alphabot2_bottom_sensors_middleman: Receives info from Gazebo bottom sensors and retransmits in standardized format to /alphabot2/bottom_sensors.
  • alphabot2_handler: Read information provide by Alphabot2's Infrared sensors and retransmits in standardized format to /alphabot2/top_sensors and /alphabot2/bottom_sensors. Also subscribe to /alphabot2/control and translate it to drive control the Alphabot2. (This node only runs on a RaspberryPI)

Description of ROS Topics:

  • /alphabot2/control: Used to control the robot movement, geometry_msgs/Twist to be publish
  • /alphabot2/vertical: Used to control Tilt from Pan-Tilt using std_msgs/Float64 (degree between -90 and 90)
  • /alphabot2/horizontal: Used to control Pan from Pan-Tilt using std_msgs/Float64 (degree between -90 and 90)
  • /alphabot2/camera/image_raw: Publishes sensor_msgs/Image from the camera module.
  • /alphabot2/top_sensors: Receives the result of the top sensors to be used by the real robot and the simulated robot. (Message type: std_msgs/Int32MultiArray)
  • /alphabot2/bottom_sensors: Receives the result of the bottom sensors to be used by the real robot and the simulated robot. (Message type: std_msgs/Int32MultiArray)

Testing controls

To control robot movement publish a geometry_msgs/Twist to /alphabot2/control topic:

rostopic pub /alphabot2/control geometry_msgs/Twist (Press Tab)

To control camera movement publish a std_msgs/Float64 to /alphabot_horizontal or /alphabot2/vertical topics with a angle between -90 and 90 degrees:

Pan

rostopic pub /alphabot2/horizontal std_msgs/Float64 "data: 45"

Tilt

rostopic pub /alphabot2/vertical std_msgs/Float64 "data: -23"

To check that it's being published the correct sensors results to the real robot and the simulated robot:

Top Sensors

rostopic echo /alphabot2/top_sensors

Bottom Sensors

rostopic echo /alphabot2/bottom_sensors

Papers related

Group G:

  • Ana Sofia Simões Correia Rafael, up201405377
  • Cássio Silva de Sá Santos, up201802025
  • Diogo Serra Duque, up201406274
  • Sara Filipa Couto Fernandes, up201405955

© FEUP

alphabot2-simulator's People

Contributors

diogoduque avatar saracouto1318 avatar sofiarafael avatar ssscassio 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.