
from baxter_myo.arm_controller import ArmController
from baxter_myo.config_reader import ConfigReader


def main():
    c = ConfigReader("demo_config")
    c.parse_all()
    s = ArmController('right', c.right_angles, c.push_thresh)
    s.move_loop()

if __name__ == "__main__":
    main()

import time
import rospy

from baxter_myo.arm_controller import ArmController
from baxter_myo.config_reader import ConfigReader


def main():
    c = ConfigReader("demo_config")
    c.parse_all()
    s = ArmController('right', c.right_angles, c.push_thresh)
    while not rospy.is_shutdown():
        s.step()

if __name__ == "__main__":
    main()

Enable ctrl-c control with rospy
Enable ctrl-c control with rospy

+ import time
+ import rospy
  
  from baxter_myo.arm_controller import ArmController
  from baxter_myo.config_reader import ConfigReader
  
  
  def main():
      c = ConfigReader("demo_config")
      c.parse_all()
      s = ArmController('right', c.right_angles, c.push_thresh)
-     s.move_loop()
+     while not rospy.is_shutdown():
+         s.step()
  
  if __name__ == "__main__":
      main()
  
Enable ctrl-c control with rospy
## Code Before:

from baxter_myo.arm_controller import ArmController
from baxter_myo.config_reader import ConfigReader


def main():
    c = ConfigReader("demo_config")
    c.parse_all()
    s = ArmController('right', c.right_angles, c.push_thresh)
    s.move_loop()

if __name__ == "__main__":
    main()

## Instruction:
Enable ctrl-c control with rospy
## Code After:
import time
import rospy

from baxter_myo.arm_controller import ArmController
from baxter_myo.config_reader import ConfigReader


def main():
    c = ConfigReader("demo_config")
    c.parse_all()
    s = ArmController('right', c.right_angles, c.push_thresh)
    while not rospy.is_shutdown():
        s.step()

if __name__ == "__main__":
    main()
