Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 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()
Exemplo n.º 9
0
 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)