Modifications to compile without ROS

Added #ifdef around a ROS definition and moved some connections into an
#ifdef statement.