tutorials/pick_and_place/Scripts_Part4/RealSimPickAndPlace.cs
/// <summary>
///   Execute robot commands receved from ROS Subscriber.
///   Gripper commands will be executed immeditately wihle trajectories will be 
///   executed in a coroutine.
/// </summary>
/// <param name="robotAction"> RobotMoveActionGoal of trajectory or gripper commands</param>
Execute robot commands receved from ROS Subscriber.
Gripper commands will be executed immeditately wihle trajectories will be
executed in a coroutine.
Execute robot commands receved from ROS Subscriber . Gripper commands will be executed immeditately wihle trajectories will be executed in a coroutine .
void ExecuteRobotCommands(RobotMoveActionGoal robotAction)
    {
        if (robotAction.goal.cmd.cmd_type == TRAJECTORY_COMMAND_EXECUTION)
        {
            StartCoroutine(ExecuteTrajectories(robotAction.goal.cmd.Trajectory.trajectory));
        }
        else if (robotAction.goal.cmd.cmd_type == TOOL_COMMAND_EXECUTION)
        {
            if (robotAction.goal.cmd.tool_cmd.cmd_type == OPEN_GRIPPER)
            {
                Debug.Log("Open Tool Command");
                OpenGripper();
            }
            else if (robotAction.goal.cmd.tool_cmd.cmd_type == CLOSE_GRIPPER)
            {
                Debug.Log("Close Tool Command");
                CloseGripper();
            }
        }
    }
void ExecuteRobotCommands ( RobotMoveActionGoal robotAction ) { if ( robotAction . goal . cmd . cmd_type == TRAJECTORY_COMMAND_EXECUTION ) { StartCoroutine ( ExecuteTrajectories ( robotAction . goal . cmd . Trajectory . trajectory ) ) ; } else if ( robotAction . goal . cmd . cmd_type == TOOL_COMMAND_EXECUTION ) { if ( robotAction . goal . cmd . tool_cmd . cmd_type == OPEN_GRIPPER ) { Debug . Log ( " " ) ; OpenGripper ( ) ; } else if ( robotAction . goal . cmd . tool_cmd . cmd_type == CLOSE_GRIPPER ) { Debug . Log ( " " ) ; CloseGripper ( ) ; } } }
Execute robot commands receved from ROS Subscriber.
Execute robot commands receved from ROS Subscriber .
robotAction
RobotMoveActionGoal
RobotMoveActionGoal of trajectory or gripper commands
RobotMoveActionGoal of trajectory or gripper commands