forked from Dobot-Arm/TCP-IP-ROS-6AXis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Robot Script and Update to Cmake
- Loading branch information
1 parent
dfe0629
commit 1fa8c75
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
import rosnode | ||
import rospy | ||
import sys | ||
import copy | ||
import rospkg | ||
from std_msgs.msg import String | ||
import dobot_v4_bringup.srv | ||
import time | ||
from dobot_v4_bringup.srv import ClearErrorRequest, EnableRobotRequest | ||
|
||
#Creating the ros node and service client | ||
rospy.init_node("dobot_arm_enabler") | ||
rospy.wait_for_service("/dobot_v4_bringup/srv/ClearError") | ||
rospy.wait_for_service("/dobot_v4_bringup/srv/EnableRobot") | ||
|
||
def EnableRobot(): | ||
time.sleep(2) | ||
clear_error_service = rospy.ServiceProxy("/dobot_v4_bringup/srv/ClearError", dobot_v4_bringup.srv.ClearError) | ||
|
||
clear_error_response = clear_error_service() | ||
if(clear_error_response.res == 0): | ||
time.sleep(2) | ||
enable_robot_service = rospy.ServiceProxy("/dobot_v4_bringup/srv/EnableRobot", dobot_v4_bringup.srv.EnableRobot) | ||
enable_robot_response = enable_robot_service() | ||
if (enable_robot_response.res != 0): | ||
EnableRobot() | ||
else: | ||
EnableRobot() | ||
|
||
if __name__ == '__main__': | ||
EnableRobot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.