ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found out how to do it. The "trick" was to set ROS_NAMESPACE before "import rospy". So

import os
os.environ["ROS_NAMESPACE"] = "/dji0"
import rospy

worked. Or using Jupyter notebook magic:

%env ROS_NAMESPACE=/dji0
import rospy