ROS tips and tricks - Ridgebeck/CarND-Capstone-Team-Herbie GitHub Wiki
You can use the command rqt_graphto plot a graph with all nodes and topics and you can visualize the relationship to each other (subscribers/publishers).
You can use the command rostopic echo /name_of_topic for checking that your inputs and outputs are correct. If you run the command in a new terminal, make sure you run source devel/setup.sh before using the echo command.
You can setup a new publisher for a simple topic for debugging your code. You can e.g. use a string topic such as self.test = rospy.Publisher('/test', String, queue_size=1) and then publish to it at any point in the program via self.test.publish("My message here").
You can use rqt_console to read and filter out the logging messages.
** Use rospy.logdebug(), rospy.loginfo() etc for logging messages.
** Run roscore, then run rqt_console. In rqt_console, you can filter out the messages per node and/or per log level. Node the you need to click the strings to enable them in the exclude/highlight filters.
** You may need to use rqt_console->settings to enable the debug messages from some nodes. There is a table in settings to do that.
** Checkout :
http://wiki.ros.org/rospy/Overview/Logging http://wiki.ros.org/rqt_console#Filtering_types
For graphical plotting of values, you can use rqt_plot, which is especially useful for tuning control loops by monitoring the inputs and outputs. You can also plot multiple values at the same time by simply giving multiple topics to rqt_plot.
Example: rqt_plot /twist_cmd/twist/linear/x /current_velocity/twist/linear/x.
You have to make sure that each topic has a timestamp in the header to get the correct x-axis value. If you get an "QXcbConnection" error, make sure that you have configured a Display for the graphical output. This can be done in bash via 'export DISPLAY=:0'.