java/src/application/LibIiwaEnum.java
<filename>java/src/application/LibIiwaEnum.javapackage application;

public enum LibIiwaEnum{
	
	// APPLICATION ERRORS
	INVALID_CONFIGURATION_ERROR(-16),
	VALIDATION_FOR_IMPEDANCE_ERROR(-15),
	ASYNCHRONOUS_MOTION_ERROR(-14),
	SYNCHRONOUS_MOTION_ERROR(-13),
	INVALID_JOINT_ERROR(-12),
	VALUE_ERROR(-11),
	ERROR(-10),

	// communication errors
	TIMEOUT(-3),
	INVALID_NUMBER_OF_BYTES(-2),
	EXCEPTION(-1),
	
	// empty commands
	COMMAND_PASS(0),
	
	// communication modes
	COMMUNICATION_MODE(0),  // empty
	COMMUNICATION_MODE_ON_DEMAND(11),
	COMMUNICATION_MODE_PERIODICAL(12),
	
	// motion types
	MOTION_TYPE(0),  // empty
	MOTION_TYPE_PTP(21), 
	MOTION_TYPE_LIN(22),
	MOTION_TYPE_LIN_REL(23),
	MOTION_TYPE_CIRC(24),
	
	// control interfaces
	CONTROL_INTERFACE(0),  // empty
	CONTROL_INTERFACE_STANDARD(31), 
	CONTROL_INTERFACE_SERVO(32), 
	CONTROL_INTERFACE_FRI(33),
	
	// control modes
	CONTROL_MODE(0),  // empty
	CONTROL_MODE_POSITION(41),
	CONTROL_MODE_JOINT_IMPEDANCE(42),
	CONTROL_MODE_CARTESIAN_IMPEDANCE(43),
	CONTROL_MODE_CARTESIAN_SINE_IMPEDANCE(44),
	
	// execution type
	EXECUTION_TYPE(0),  // empty
	EXECUTION_TYPE_ASYNCHRONOUS(51),
	EXECUTION_TYPE_SYNCHRONOUS(52),

	// control command
	COMMAND_STOP(101),
	COMMAND_JOINT_POSITION(102),
	COMMAND_CARTESIAN_POSE(103),
	COMMAND_CIRC_MOTION(104),

	// configuration commands (limits)
	COMMAND_SET_DESIRED_JOINT_VELOCITY_REL(201),
	COMMAND_SET_DESIRED_JOINT_ACCELERATION_REL(202),
	COMMAND_SET_DESIRED_JOINT_JERK_REL(203),
	COMMAND_SET_DESIRED_CARTESIAN_VELOCITY(204),
	COMMAND_SET_DESIRED_CARTESIAN_ACCELERATION(205),
	COMMAND_SET_DESIRED_CARTESIAN_JERK(206),

	// configuration commands (conditions)
	COMMAND_SET_FORCE_CONDITION(211),
	COMMAND_SET_JOINT_TORQUE_CONDITION(212),
	
	// configuration commands (impedance control)
	COMMAND_SET_CARTESIAN_STIFFNESS(221),
	COMMAND_SET_CARTESIAN_DAMPING(222),
	COMMAND_SET_CARTESIAN_ADDITIONAL_CONTROL_FORCE(223),
	COMMAND_SET_CARTESIAN_MAX_CONTROL_FORCE(224),
	COMMAND_SET_CARTESIAN_MAX_CARTESIAN_VELOCITY(225),
	COMMAND_SET_CARTESIAN_MAX_PATH_DEVIATION(226),
	COMMAND_SET_JOINT_STIFFNESS(227),
	COMMAND_SET_JOINT_DAMPING(228),
	COMMAND_SET_CARTESIAN_SINE_AMPLITUDE(229),
	COMMAND_SET_CARTESIAN_SINE_FREQUENCY(230),
	COMMAND_SET_CARTESIAN_SINE_PHASE(231),
	COMMAND_SET_CARTESIAN_SINE_BIAS(232),
	COMMAND_SET_CARTESIAN_SINE_FORCE_LIMIT(233),
	COMMAND_SET_CARTESIAN_SINE_POSITION_LIMIT(234),
	COMMAND_SET_CARTESIAN_SINE_TOTAL_TIME(235),
	COMMAND_SET_CARTESIAN_SINE_RISE_TIME(236),
	COMMAND_SET_CARTESIAN_SINE_HOLD_TIME(237),
	COMMAND_SET_CARTESIAN_SINE_FALL_TIME(238),
	COMMAND_SET_CARTESIAN_SINE_STAY_ACTIVE_UNTIL_PATTERN_FINISHED(239),
	COMMAND_SET_CARTESIAN_SINE_CREATE_DESIRED_FORCE(240),
	COMMAND_SET_CARTESIAN_SINE_CREATE_SINE_PATTERN(241),
	COMMAND_SET_CARTESIAN_SINE_CREATE_LISSAJOUS_PATTERN(242),
	COMMAND_SET_CARTESIAN_SINE_CREATE_SPIRAL_PATTERN(243),

	// configuration commands (motion and control)
	COMMAND_SET_COMMUNICATION_MODE(301),
	COMMAND_SET_CONTROL_INTERFACE(302),
	COMMAND_SET_MOTION_TYPE(303),
	COMMAND_SET_CONTROL_MODE(304),
	COMMAND_SET_EXECUTION_TYPE(305),
	
	// configuration commands (tools)
	COMMAND_SET_TOOL(400);
	
	
	private int code;
	
	LibIiwaEnum(double code){
		this.setCode(code);
	}

	public int getCode() {
		return code;
	}

	public void setCode(double code) {
		this.code = (int)Math.round(code);
	}
}
