Skip to content

fedehub/rt2_assignment1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First assignment Research Track course - second module

Table of contents

-Index

General Instructions

The Professor's package has been modified by creating this repository, containing the given package and two additional branches:

  1. action
  2. ros2

Finally, in the main branch, I added a Vrep scene containing the robot interacting with the simulation. I will briefly introduce it in the following section

Vrep scene

The sceneVrep.ttt file contains an ad-hoc scene adressed to the robot simulator (Coppelliasim). Moreover, a robot_pioneer_ctrl has been placed within the Coppelliasim environment. The robot's motion is controlled through a ROS node belonging to the rt2_assignment package, inside the main branch. In order to communicate with the robot, a pubisher to the /odomtopic has been decleared (within the robot child script). It is responsible for the announcement of the actual robot postion which will be then exploited by the subsciber of the /odom topic go_to_point.py. To conclude with, to set the actuator velocity a subscriber to the /cmd_vel topic has been introduced by means Twist message published within the go_to_point.py script.

Foundamental Packages

  • SimExtRos: The ROS2 Interface plugin for CoppeliaSim
  • Coppeliasim it allows to integrate Vrep with ROS
  • Ros1_bridge to let some portions of code written in ROS communicate with code in ROS2

The "action" branch

This latter, should contain the same package in ROS, but with the go_to_point node modelled as a ROS action server, instead of a “simple” server. Given that, the robot FSM node should now implement mechanisms for possibly cancelling the goal, when the related user command is received. For more details, please click here

The "ros2" branch

In the branch ros2, the cpp nodes (Robot FSM and position server) should be written for ROS2, as components, so that, by using the ros1_bridge, they can be interface with the ROS nodes and with the simulation in Gazebo. The go_to_point can still be implemented as a service. Also:

  1. a launch file to start the container manager and the components, should be created
  2. a script to launch all required nodes and the simulation should be implemented

For more details, please click here

Scripts Folder

Here below is reported a brief description of the content of this folder:

  • user_interface.py implementing the user interface which basically allows the user to:
    • start the robot movement by pressing 1
    • stopping the robot movement by pressing 0
  • go_to_point.py implementing a service to drive a robot toward a point in the environment

Src Folder

Here we can find, as for the ros2 branch, two files, respectively:

  1. state_machine.cpp The SM has been implemented as a service server whose activation depends on a boolean variable (start) retrieved by the ui_client, as request, within the [user_interface.py]. The state_machine.cpp node also constitutes a service client for both:
    • /go_to_point
    • /position_server

REMARK: if the boolean varaiable "start" is set to true, it asks for a random position to then set its response equal to the request values of the the /go_to_point service.

  1. position_service.cpp It is implemented as a service Server Node and it replies with random values for x,y and theta where x and y should be limited between some max and min values (given as request)

SRV folder

It basically contains three different custom services:

  1. Command: It takes:
    • as request: a string
    • as reply: a Boolean
  2. RandomPosition It takes:
    • as request: a minimum and a maximum x-y coordinates' value
    • as reply: a random x, y and theta angle value
  3. Position It takes:
    • as request: a position to reach
    • as reply: a boolean

Launch folder

Here we can find the three launch files, singularly exploited among the branches

  1. simVrep.launch Launch file for starting the four nodes interacting with Vrep
  2. sim.launch Launch file for starting the four nodes and the overall simulation
  3. sim2.launch Launch file for starting the container manager and the components which have been created

Launch the simulation

To launch the node, please

  1. download coppelliasim at: http://www.coppeliarobotics.com/downloads.html
  2. launch the ROS master in background
roscore &

  1. In a second tab, please run
./coppeliasim.sh

  1. Load the scene in Coppeliasim
  2. Open a third terminal tab and launc
roslaunch rt2_assignment1 simVrep.launch

Release History

  • 0.1.0

  • The first proper release

  • 0.0.1

  • Work in progress

Meta

Federico Civetta– s4194543 – fedeunivers@gmail.com

https://github.com/fedehub

Contributing

  1. Fork it (https://github.com/fedehub/rt2_assignment1/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

About

First and second assignment of RT second module

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published