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 have resolved the issue.. I just changed the sequence of the code.

Previously: class MyFsm: def __init__(self): self.pub = rospy.Publisher('state', State, queue_size=10) self.server = rospy.Service('transition', MyService, self.handle_trigger_transition) #self.duration = rospy.get_param("Duration") self.timer = rospy.Timer(rospy.Duration(0.5), self.my_callback(self)) self.state = State.START

I have resolved the issue.. I just changed the sequence of the code.

Previously: class MyFsm: def __init__(self): self.pub = rospy.Publisher('state', State, queue_size=10) self.server = rospy.Service('transition', MyService, self.handle_trigger_transition) #self.duration

self.duration = rospy.get_param("Duration") rospy.get_param("Duration")

self.timer = rospy.Timer(rospy.Duration(0.5), self.my_callback(self)) self.state = State.START

Now: class MyFsm: def __init__(self): self.pub = rospy.Publisher('state', State, queue_size=10) self.state = State.START self.server = rospy.Service('transition', MyService, self.handle_trigger_transition) self.timer = rospy.Timer(rospy.Duration(0.5), self.my_callback)

It solved the issue..!

click to hide/show revision 3
No.3 Revision

I have resolved the issue.. I just changed the sequence of the code.

Previously: Previously:

class MyFsm: 
 def __init__(self): 
 self.pub = rospy.Publisher('state', State, queue_size=10) 
 self.server = rospy.Service('transition', MyService, self.handle_trigger_transition) 

#self.duration = rospy.get_param("Duration")

self.duration = rospy.get_param("Duration")

self.timer = rospy.Timer(rospy.Duration(0.5), self.my_callback(self)) self.state = State.STARTState.START

Now:

Now:

class MyFsm:
    def __init__(self):
        self.pub = rospy.Publisher('state', State, queue_size=10)
        self.state = State.START
        self.server = rospy.Service('transition', MyService, self.handle_trigger_transition)
        self.timer = rospy.Timer(rospy.Duration(0.5), self.my_callback)

self.my_callback)

It solved the issue..!