Beispiel #1
0
 def disengage_brakes(self):
     rospy.loginfo("Trying to disengage brakes...")
     msg_jr = JointReset()
     msg_jr.joints_mask = (1 << self.NUMBER_OF_JOINTS) - 1
     msg_jr.disengage_steps = 2000
     msg_jr.disengage_offset = 3.5
     self._joint_reset_command_pub.publish(msg_jr)  # /bridge_jnt_reset
     rospy.loginfo("Brakes should be disengaged")
Beispiel #2
0
    def run(self):
        print("read worker has started")
        publisher = rospy.Publisher('bridge_jnt_reset',
                                    JointReset,
                                    queue_size=2)
        try:
            while self.running:
                msg = self.socket.recv(1024)
                if msg == b'':
                    raise Exception("Client disconnected socket.")
                print("Message recieved " + msg.decode())
                if msg.decode() == "brake":
                    # TODO find a way to brake the robot with ROS.
                    print("breaking the robot -> not implemented")
                    pass
                if msg.decode() == "unbrake":
                    print("unbreaking the robot")
                    ros_msg = JointReset(63, 2000, 3.5)
                    publisher.publish(ros_msg)

        except Exception as e:
            print(e)
            raise e