Scratchpad - ROS 1

A scratchpad for common pitfalls, commands, and shortcuts when using ROS 1.

Questions/Answers

Error: RQT doesn't list plugins on startup:

Remove its cache, then it works: rm ~/.config/ros.org/rqt_gui.ini

Source: https://answers.ros.org/question/91231/rqt-plugin-not-listedfound-in-list-returned-by-rqt-list-plugins/

I’m getting the following error: multiple files named ... in package

Disable install space.

catkin clean
catkin build <package-name> --no-install

Run catkin for the package in the current directory:

catkin build --this -DCMAKE...

Publish to /move_base_simple/goal:

rostpic pub /move_base_simple/goal geometry_msgs/PoseStamped '{header: {stamp: now, frame_id: "map"}, pose: {position: {x: 1.0, y: 0.0, z: 0.0}, orientation: {w: 1.0}}}'

Source: https://answers.ros.org/question/47973/publishing-to-move_base_simplegoal/

image_transport plugins - how to setup:

sudo apt-get install ros-melodic-*-image-transport
rosrun image_transport republish compressed /in/compressed:=/<path-to-topic>/compressed_image0  "raw" out:=/<path-to-topic>/image0

Source: http://wiki.ros.org/image_transport/Tutorials/ManagingPlugins

Use ninja when building with catkin_make

catkin_make --use-ninja --cmake-args -DCMAKE_BUILD_TYPE=Release

Adjust logger verbosity - inspect “debug” messages:

Run the rqt_logger_level GUI:

rosrun rqt_logger_level rqt_logger_level

Alternatively adjust it using the service call:

rosservice list
rosservice call /rviz_123/get_loggers <tab><tab>
rosservice call /rviz_123/set_logger_level <tab><tab>

Adjust the logger verbosity from the start of the run

Define your own ROSCONSOLE_CONFIG_FILE variable + config file.

rosconsole will load a config file from $ROS_ROOT/config/rosconsole.config when it initializes.

rosconsole also lets you define your own configuration file that will be used by log4cxx, defined by the ROSCONSOLE_CONFIG_FILE environment variable. Anything defined in this config file will override the default config file.

A simple example:

# Set the default ros output to warning and higher
log4j.logger.ros=WARN
# Override my package to output everything
log4j.logger.ros.my_package_name=DEBUG

Have detailed output for debugging

# Try one of the following
export ROSCONSOLE_FORMAT='[${severity}] [${time}]: ${message}' # default
export ROSCONSOLE_FORMAT='${severity} | ${time} | ${message}'
export ROSCONSOLE_FORMAT='${severity} | ${node} | ${time} | ${message} | ${file}:${line}'
export ROSCONSOLE_FORMAT='${severity} | ${node} - ${thread} | ${time} | ${message} | +${line} ${file}'