Skip to content

Drag-and-Teach Command Set

Drag teaching

During the drag teaching, the RealMan robotic arm records the drag trajectory and replays the trajectory according to the user's commands.

Set 6-DoF Drag Teaching Mode set_force_drag_mode

Only effective in the 6-DoF drag teaching mode.

  • Input parameter
DescriptionTypeExplanation
set_force_drag_modestringSet the 6-DoF drag teaching mode.
modeint6-DoF drag teaching mode, 0 - Fast Drag Mode, 1 - Precision Drag Mode.
  • Code demo

Input

json
{"command":"set_force_drag_mode","mode":1}

Output

Setting succeeded (true: setting succeeded, false: setting failed).

json
{
    "command": "set_force_drag_mode",
    "set_state": true
}

Query 6-DoF Drag Teaching Modeget_force_drag_mode

Only effective in the 6-DoF drag teaching mode.

  • Input parameter
DescriptionTypeExplanation
get_force_drag_modestringQuery the 6-DoF drag teaching mode.
  • Output parameter
ParameterTypeExplanation
modeint6-DoF drag teaching mode, 0 - Fast Drag Mode, 1 - Precision Drag Mode.
  • Code demo

Input

json
{"command":"get_force_drag_mode"}

Output

json
{
    "command": "get_force_drag_mode",
    "mode": 1
}

Start the drag teaching start_drag_teach

  • Input parameter
ParameterTypeDescription
start_drag_teachstringStart the drag teaching.
trajectory_recordintTrajectory record during the drag teaching, 0: no record, 1: trajectory record.
  • Code demo

Input

json
{"command":"start_drag_teach","trajectory_record":1}

Output

Setting succeeded (true: setting succeeded, false: setting failed).

json
{
    "command": "start_drag_teach",
    "drag_teach": true
}

Stop the drag teaching stop_drag_teach

  • Input parameter
ParameterTypeDescription
stop_drag_teachstringStop the drag teaching.
json
{"command":"stop_drag_teach"}

Output Setting succeeded (true: setting succeeded, false: setting failed).

json
{
    "command": "stop_drag_teach",
    "drag_teach": true
}

Start the multiple drag teaching start_multi_drag_teach

  • Input parameter
ParameterTypeDescription
start_multi_drag_teachstringStart the multiple drag teaching.
frameintReference frame, 0: work frame, 1: tool frame.
free_axesintFree driving directions, the first three elements indicate that the TCP will translate and drag in the x, y, and z axes of the reference frame, while the last three elements indicate that the TCP will rotate and drag in the rx, ry, and rz axes of the reference frame.
singular_wallintOptional, available only for the drag teaching in the 6-DoF force mode to enable or disable the drag singular wall, 0: disable drag singular wall, 1: enable drag singular wall, default: enable drag singular wall if no settings.
  • Code demo

Input

json
{"command":"start_multi_drag_teach","free_axes":[0,1,1,0,1,0],"frame":0,"singular_wall":0}

Output

Setting succeeded:

json
{
    "command": "start_multi_drag_teach",
    "set_state": true
}

Setting failed:

json
{
    "command": "start_multi_drag_teach",
    "set_state": false
}

WARNING

Possible reasons for failure:

  • The current robotic arm is not the 6-DoF force version (drag teaching in the 6-DoF force mode)
  • The robotic arm is currently in an IO emergency stop state
  • The robotic arm is currently in the simulation mode
  • The input parameters are incorrect
  • During the drag teaching in the 6-DoF force mode, the robotic arm is currently in the singular zone

Start the trajectory replay run_drag_trajectory

  • Input parameter
ParameterTypeDescription
run_drag_trajectorystringStart the trajectory replay.
  • Code demo

Input

json
{"command":"run_drag_trajectory"}

Output Replay succeeded:

json
{
    "command": "run_drag_trajectory",
    "run_state": true
}

Replay failed:

json
{
    "command": "run_drag_trajectory",
    "run_state": false
}

Pause the trajectory replay pause_drag_trajectory

Pause the trajectory replay.

  • Input parameter
ParameterTypeDescription
pause_drag_trajectorystringPause the trajectory replay.
  • Code demo

Input

json
{"command":"pause_drag_trajectory"}

Output Pause succeeded:

json
{
    "command": "pause_drag_trajectory",
    "pause_state": true
}

Pause failed:

json
{
    "command": "pause_drag_trajectory",
    "pause_state": false
}

Continue the trajectory replay continue_drag_trajectory

Continue the trajectory replay after a pause.

  • Input parameter
ParameterTypeDescription
continue_drag_trajectorystringContinue the trajectory replay.
  • Code demo

Input

json
{"command":"continue_drag_trajectory"}

Output Continuation succeeded:

json
{
    "command": "continue_drag_trajectory",
    "continue_state": true
}

Continuation failed:

json
{
    "command": "continue_drag_trajectory",
    "continue_state": false
}

Stop the trajectory replay stop_drag_trajectory

  • Input parameter
ParameterTypeDescription
stop_drag_trajectorystringStop the trajectory replay.
  • Code demo

Input

json
{"command":"stop_drag_trajectory"}

Output Stop succeeded:

json
{
    "command": "stop_drag_trajectory",
    "stop_state": true
}

Stop failed:

json
{
    "command": "stop_drag_trajectory",
    "stop_state": false
}

Move to the trajectory origin drag_trajectory_origin

Before the trajectory replay, it is required to move the robotic arm to the trajectory origin. If the setting is correct, the robotic arm will move to the trajectory origin at a speed of 20%.

  • Input parameter
ParameterTypeDescription
drag_trajectory_originstringTrajectory origin.
  • Code demo

Input

json
{"command":"drag_trajectory_origin"}

Output

json
{
    "device": 0,
    "state": "current_trajectory_state",
    "trajectory_connect": 0,
    "trajectory_state": true
}

Save the drag teaching trajectory save_trajectory

  • Input parameter
ParameterTypeDescription
save_trajectorystringSave the trajectory.
trajectory_nameintName of the trajectory.
  • Output parameter
ParameterTypeDescription
pointlistDrag teaching point.
  • Code demo

Input

Execution: Save the trajectory that has just been dragged, and call it after drag teaching.

json
{"command":"save_trajectory","trajectory_name":"XXX"}

Output

json
{
    "point": [
        30971,
        56885,
        -3416,
        76201,
        47121,
        -4845
    ]
}

Set the drag teaching sensitivity of the current loop set_drag_teach_sensitivity

  • Input parameter
ParameterTypeDescription
set_drag_teach_sensitivitystringSet the drag teaching sensitivity of the current loop
  • Code demo

Input

Execution: Grade from 0% to 100%

json
{"command":"set_drag_teach_sensitivity","grade":0}

Output

Setting succeeded:

json
{
    "command": "set_drag_teach_sensitivity",
    "set_state": true
}

Setting failed:

json
{
    "command": "set_drag_teach_sensitivity",
    "set_state": false
}

WARNING

The sensitivity grade ranges from 0 to 100, the smaller the number, the lower the sensitivity. The initial sensitivity is kept when it is 100.

Get the drag teaching sensitivity of the current loop get_drag_teach_sensitivity

  • Input parameter
ParameterTypeDescription
get_drag_teach_sensitivitystringGet the drag teaching sensitivity of the current loop
  • Code demo

Input

Execution: Grade from 0% to 100%

json
{"command":"get_drag_teach_sensitivity"}

Output

Success:

json
{
    "command": "get_drag_teach_sensitivity",
    "grade": 0
}

WARNING

The sensitivity grade ranges from 0 to 100, the smaller the number, the lower the sensitivity. The initial sensitivity is kept when it is 100.