Search
The main task is to implement ROS modules based on the tasks: T1a-ctrl, T1c-map, T1d-plan, and T1e-expl and thus create an integrated solution for autonomous robotic exploration.
Implement ROS nodes to solve the exploration tasks. The provided resource pack support deployment using both the V-REP and STDR simulators. Moreover, an R-VIZ setup file is provided to visualize the robot knowledge of the environment using the messages published by the individual ROS nodes.
The simulators provide and process the following inputs and outputs, respectively
To run the V-REP simulator
blocks.ttt
roslaunch uir_tools uir_backend_vrep.launch
rospy.Time.now()
/clock
To run the STDR simulator
roslaunch uir_tools uir_backend_stdr.launch
The provided RVIZ setup file may be used to visualize the following topics
A demonstration of the working robotic exploration in STDR or V-REP simulator is evaluated by an instructor during the labs.
The individual nodes roughly correspond to T1a-ctrl, T1c-map, and T1d-plan paired with T1e-expl. The following text describes the recommended architecture of ROS modules, and extends the idea of robotic exploration.
Note, it is strongly recommended to first prepare the ROS interface and test whether the messages are correctly sent and received. Then, connect all the interfaces within the ROS framework and test all the modules together.
The path following module drives the robot along a given path by publishing velocity commands.
Unlike in T1a-ctrl, where the left and right velocity is used control the robot, the simulators accept geometry_msgs/Twist. Therefore, for your convenience a simplistic path follower is already prepared in the resource pack's uir_path_follower node.
uir_path_follower
The mapping module incrementally builds a map of the robot surroundings from the robot sensoric measurements.
The exploration module selects the exploration goals and plans paths for the robot to explore.
This node is based on the tasks T1d-plan and T1e-expl. In the frontier based approach, the path is to be planned to the closest location selected among the detected frontiers, i.e., the borders between the free and unknown space. Note, it is beneficial to cluster the observed frontiers cells to reduce the computational load of goal selection. Moreover, keep in mind that even in a simulator the path is not executed perfectly. Therefore, using a safety margin around the walls is advisable.
To run the ROS nodes, it is strongly recommended to use either Ubuntu 16 with ROS Kinetic or Ubuntu 18 with ROS Melodic. Detailed installation instructions may be found on ROS web pages ROS Kinetic, ROS Melodic.
On the lab computers, ROS Kinetic is already preinstalled but two more libraries need to be installed before using it.
pip install rospkg pip install netifaces
~/.bashrc
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
Finally, on Ubuntu 16 the STDR simulator is installed using
sudo apt-get install ros-kinetic-stdr-*
On Ubuntu 16 and 18 the ROS workspace is created as follows
cd ~/ mkdir rds_ws mkdir rds_ws/src cd rds_ws catkin_make # source the workspace cd devel devel_path=$(pwd) echo "source $devel_path/setup.bash" >> ~/.bashrc source setup.bash # Add new (custom) package to the workspace cd ~/rds_ws/src # Go to src folder in your workspace. ln -s [path to your package] # Create symlink to your package (or place the whole package directly to src). cd ~/rds_ws catkin_make # Compile the workspace. rospack list # Make sure that your pack is known. (Sometimes this is necessary to refresh ROS. ) # Now, you should be able to use the package within ROS (rosrun or roslaunch). # useful commands rostopic list # all current topics in the ROS system rostopic info [topic name] # show info about topic - publishers, subscribers rostopic echo [topic name] # writes msgs data on certain topic to stdout rostopic hz [topic name] # prints frequency of msgs on a certain topic rosnode list # all currently running nodes rosnode info [node name] # info about the node: published topics, subscribed topics # useful tools rqt_graph # visualize connection between the nodes (might not be 100% accurate) rviz # spatial visualization of the msgs rosrun tf view_frames # creates pdf with a visualization of the whole transformation tree (all the /tf msgs in the system) rosbag record # capture ROS msgs on selected topics (data can be played with selected speed afterwards) rosbag play [bagfile] # play data saved in bagfile
The main study material for ROS is http://wiki.ros.org/ROS/Tutorials. A special attention should be given to ROS message-based communication presented in http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29.