This is the package to get if you want to install ERA. The rosinstall script will fetch the necessary packages in the catkin workspace.
We recommend installing Ubuntu 18.04 with ROS Melodic. Installation instructions can be found here using Gazebo simulator or here using CARLA simulator
To launch the workload without the Gazebo and RViz GUIs:
roslaunch era_gazebo era_playback.launch bag_name:=/*your_home_folder*/catkin_ws/src/era_gazebo/bagfiles/cmd_vel_r0.bag gui:=false
(it may be necessary to prepend DISPLAY=:0
to the command above in some cases)
To launch the workload enabling Linux perf profiling:
roslaunch era_gazebo era_playback.launch bag_name:=/*your_home_folder*/catkin_ws/src/era_gazebo/bagfiles/cmd_vel_r0.bag gui:=false prof:=true
Although roslaunch
will also start roscore (ROS's main engine required for any ROS execution), a cleaner approach consists in having it running as an OS daemon or service. Specifically for Ubuntu 15.04 and later, this can be done by creating a new systemd service called roscore.service
in /lib/systemd/system
(see code snippet below) and copying the roscore_service.sh
script provided as part of era_gazebo to /usr/local/bin
:
[Unit]
Description=start roscore
After=remote-fs.target
After=syslog.target
[Service]
ExecStart=/usr/local/bin/roscore_service.sh
Restart=on-abort
[Install]
WantedBy=multi-user.target
Finally, start roscore.service
:
sudo systemctl start roscore.service
We provide support for ERA profiling through two complementary approaches: GNU Radio's performance counters [1][2], and Linux perf [3].
GNU Radio implements performance counters that can be used to capture/monitor information about a block inside a running flowgraph [1][2]. To enable them, GNU Radio has to be compiled from sources with specific cmake
flags. Please, refer to the ERA Wiki for detailed information. In addition, performance counters has to be enabled in ${prefix}/etc/gnuradio/conf.d/gnuradio-runtime.conf
, where ${prefix}
is GNU Radio's installation directory (e.g. /opt/gnuradio/
):
[PerfCounters]
on = True
export = True
clock = thread
[ControlPort]
on = True
edges_list = True
At runtime, performance counters can be collected using the gr-perf-to-csv
script in dsrc/gr-foo/utils. For example, once ERA is steadily running, execute the following commands in a different terminal:
cd ~/catkin_ws/src/dsrc/gr-foo/utils/
./gr-perf-to-csv 127.0.0.1 <port>
where <port>
is the Apache Thrift port through which the running flowgraph publishes its counters. This port number is shown during the initialization of ERA, with a message similar to this one:
gr::log :INFO: controlport - Apache Thrift: -h host_name -p port_number
GNU Radio's performance counters provide coverage only for GNU Radio flowgraphs. In order to collect end-to-end ERA profiling data, we also support Linux perf [3]. Once ERA is steadily running, execute the following commands in a different terminal:
cd ~/catkin_ws/src/era_gazebo/utils/
./profile_era.py
The profile_era.py
script (era_gazebo/utils) invokes Linux perf as root. It can also be invoked without root privileges, but in this case the profiling data could lack of some kernel-related information. Also, note that the execution of profile_era.py
has to be manually stopped by the user (Ctrl-C).
Linux perf generates a binary file (output.perf
) that can be analyzed with the following command:
sudo perf report -g -i output.perf
As an alternative to the use of bag files, as explained before, the robots can be teleoperated using the keyboard. Each robot is controlled independently; therefore, for each one, open a separate terminal and execute the following command:
roslaunch era_gazebo keyboard_teleop.launch namespace:=<robot_id>
Replace <robot_id>
with the ID of the robot to be controlled, like r0
and r1
.
In simulation mode (i.e. when using Gazebo to simulate the world and robots), the frame rate of the Kinect depth camera attached to Turtlebots can be adjusted by editing the update_rate
element in the corresponding Xacro file (e.g. turtlebot_gazebo.urdf.xacro
):
<xacro:macro name="turtlebot_sim_3dsensor">
<gazebo reference="camera_link">
<sensor type="depth" name="camera">
<update_rate>30.0</update_rate>
...
Also, be sure to set the plugin's update rate to 0 in order to allow the parent <sensor>
tag to control the frame rate:
<plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">
<updateRate>0</updateRate>
...
Augusto Vega (IBM)
Akin Sisbot (IBM)
[email protected]
[email protected]
[1] https://wiki.gnuradio.org/index.php/PerformanceCounters
[2] T. Rondeau, T. O'Shea, and N. Goergen. "Inspecting GNU Radio Applications with Controlport and Performance Counters." In Proceedings of the second workshop on Software radio implementation forum (SRIF '13). 2013.