예제 #1
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def shift_pose(self, axis, value):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.SHIFT_POSE
     goal.cmd.shift.axis_number = axis
     goal.cmd.shift.value = value
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #2
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def push_air_vacuum_pump(self, vacuum_pump_id):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.TOOL
     goal.cmd.tool_cmd.tool_id = int(vacuum_pump_id)
     goal.cmd.tool_cmd.cmd_type = self.tool_command_list[
         'push_air_vacuum_pump']
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #3
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def open_gripper(self, gripper_id, speed):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.TOOL
     goal.cmd.tool_cmd.tool_id = int(gripper_id)
     goal.cmd.tool_cmd.cmd_type = self.tool_command_list['open_gripper']
     goal.cmd.tool_cmd.gripper_open_speed = speed
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #4
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def deactivate_dc_motor(self, dc_motor_id, pin):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.TOOL
     goal.cmd.tool_cmd.tool_id = int(dc_motor_id)
     goal.cmd.tool_cmd.cmd_type = self.tool_command_list[
         'deactivate_digital_io']
     goal.cmd.tool_cmd.gpio = pin
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #5
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def setup_laser(self, laser_id, pin):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.TOOL
     goal.cmd.tool_cmd.tool_id = int(laser_id)
     goal.cmd.tool_cmd.cmd_type = self.tool_command_list[
         'setup_digital_io']
     goal.cmd.tool_cmd.gpio = pin
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #6
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def activate_electromagnet(self, electromagnet_id, pin):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.TOOL
     goal.cmd.tool_cmd.tool_id = int(electromagnet_id)
     goal.cmd.tool_cmd.cmd_type = self.tool_command_list[
         'activate_digital_io']
     goal.cmd.tool_cmd.gpio = pin
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #7
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def move_pose(self, x, y, z, roll, pitch, yaw):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.POSE
     goal.cmd.position.x = x
     goal.cmd.position.y = y
     goal.cmd.position.z = z
     goal.cmd.rpy.roll = roll
     goal.cmd.rpy.pitch = pitch
     goal.cmd.rpy.yaw = yaw
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)
예제 #8
0
#! /usr/bin/env python

import roslib
# roslib.load_manifest('actionlib_test')
import rospy
import actionlib

from gauss_msgs.msg import RobotMoveAction
from gauss_msgs.msg import RobotMoveGoal
from gauss_msgs.msg import RobotMoveResult
from gauss_commander.command_type import CommandType as MoveCommandType

if __name__ == '__main__':
    rospy.init_node('robot_action_client')

    client = actionlib.SimpleActionClient('/gauss/commander/robot_action',
                                          RobotMoveAction)
    if not client.wait_for_server(rospy.Duration(5.0)):
        exit
    goal = RobotMoveGoal()
    goal.cmd.cmd_type = MoveCommandType.JOINTS
    goal.cmd.joints = [0, 0, 0, 0, 0, 0]
    client.send_goal(goal)
    client.wait_for_result(rospy.Duration.from_sec(10.0))
    result = client.get_result()
예제 #9
0
파일: gauss_api.py 프로젝트: mbyase/gauss
 def move_joints(self, joints):
     goal = RobotMoveGoal()
     goal.cmd.cmd_type = MoveCommandType.JOINTS
     goal.cmd.joints = joints
     return self.execute_action('gauss/commander/robot_action',
                                RobotMoveAction, goal)