ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I have a similar project, it works like that:
In the packages folder yet, a file called initialize.py, where I have:
import rospy as _rospy from std_msgs.msg import String as _String, Empty as _Empty
def init():
_rospy.init_node('controller', anonymous=True)
global _sub
_sub = _rospy.Subscriber("/model_name", _String, _nameCallback)
global _pub
_pub = _rospy.Publisher(_controllerName+'/encoder_updated',_Empty)
List item
In the root folder, my script that imports the initialize library:
import packages.initialize
initialize.init()
2 | No.2 Revision |
I have a similar project, it works like that:
In the packages folder yet, a file called initialize.py, where I have:
import rospy as _rospy from std_msgs.msg import String as _String, Empty as _Empty
def init():
_rospy.init_node('controller', anonymous=True)
global _sub
_sub = _rospy.Subscriber("/model_name", _String, _nameCallback)
global _pub
_pub = _rospy.Publisher(_controllerName+'/encoder_updated',_Empty)
List item
In the root folder, my script that imports the initialize library:
import packages.initialize
initialize.init()