Pandorabots icon Pandorabots — Connects ARC to Pandorabots for AI chat, sends text and gets replies (executes [EZ-Script]), integrates with speech recognition and custom bots Try it →
 
Structure Sensor Robot Skill

Structure Sensor

by Occipital

Structure Sensor depth, obstacle scanning, 3D scanning, recording, playback, and paired-color vision for robots via OpenNI2

Requires ARCx v2 (Updated 10/29/2026)
Tags: Camera Infrared Distance Navigation
Compatible with: Compatible with Microsoft Windows 10 or 11 Windows Compatible with ARM Linux (Raspberry pi, etc) ARM Compatible with Linux Linux Compatible with MacOS MacOS

How to add the Structure Sensor robot skill

  1. Load the most recent release of ARCx on a compatible operating system (Get ARCx).
  2. Press the + Skills menu from the top menu bar in ARCx.
  3. Choose any of these category tabs, the robot skill appears in each of them: Camera, Infrared Distance, Navigation.
  4. Press the Structure Sensor icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Structure Sensor robot skill.


How to use the Structure Sensor robot skill

Turns an Occipital Structure Sensor (the original ST01, the one with the USB "hacker cable") into a depth sensor and 3D scanner for your robot. The depth becomes an obstacle scan for the Navigation Messaging System (NMS), with the floor removed by height and drops in the floor found, so a navigator such as Another Navigator can map and avoid things a lidar would miss. The infrared camera and a false-colour depth picture become video sources, every detection a vision skill makes on the infrared picture (or on a paired colour camera) gets its real distance measured, and the thing the Structure Sensor is famous for, 3D scanning, merges many depth frames into one dense, coloured point cloud you can open in MeshLab, CloudCompare or Blender. It records what the sensor sees to OpenNI .oni files and plays them back as if they were the sensor.

It talks to the sensor through OpenNI2, which the skill ships for Windows x64 and Linux x64 and ARM64, so it also drives the other PrimeSense family sensors: the ASUS Xtion, Xtion Pro, Xtion Pro Live and the PrimeSense Carmine. A built-in simulator lets you build and try a project, its navigation, 3D scans and scripts before the sensor arrives.

Supported sensors

Sensor Supported Notes
Structure Sensor (ST01, the original, 2013 to 2018) Yes Depth and infrared through OpenNI2. It has no colour camera: pair it with any ARCx camera for colour (below). Needs the USB hacker cable to connect to a computer.
ASUS Xtion, Xtion Pro Yes Depth and infrared.
ASUS Xtion Pro Live, PrimeSense Carmine 1.08 and 1.09 Yes Depth, infrared or colour, with the depth lined up with the colour camera inside the sensor.
Structure Core No It is not an OpenNI2 device. Occipital's (now XRPro's) Structure SDK for it is C++ only and only available to registered developers, so it is not part of this skill. See "About the Structure Core" at the end.
Structure Sensor Mark II, Structure Sensor Pro No The vendor supports them on iOS (iPad) only.
Kinect for Xbox 360 Use the Kinect Xbox 360 Depth Mapping robot skill

Only the Structure Sensor's OpenNI2 path has been written for this skill; it has not been tested with a physical sensor yet. The simulator, recordings and the bundled OpenNI2 libraries have been tested.

Setting up the sensor

Windows

  1. Download "OpenNI 2 SDK for Windows x64" from structure.io/openni and install it. It installs the PrimeSense sensor driver the sensor needs; the skill brings its own copy of the OpenNI2 libraries, so nothing else from the installer is used.
  2. Plug the sensor in with its USB hacker cable (and, for an Xtion or Carmine, its USB cable). Device Manager lists it under "PrimeSense".
  3. Press refresh in the skill's window and choose the sensor, or leave "First sensor found".

The configuration's Sensor tab says when the driver is missing.

Linux (Ubuntu 24.04, x64 and ARM64)

The skill ships OpenNI2 for both. Linux only lets ordinary users open the sensor once its udev rule is installed: the configuration's Sensor tab shows the command to run once (it copies the rule the skill ships to /etc/udev/rules.d and reloads udev), then unplug and replug the sensor. Installing Ubuntu's own OpenNI2 does the same and is a fallback if the shipped library cannot load:

sudo apt install libopenni2-0

macOS

The skill ships no OpenNI2 for macOS. Occipital's only macOS build (structure.io/openni) is for Intel Macs, from 2013, and expects libusb from MacPorts, and there is no build for Apple silicon. Build OpenNI2 from github.com/occipital/OpenNI2 with Homebrew's libusb (brew install libusb) and enter the path of the libOpenNI2.dylib it makes, with its OpenNI2/Drivers folder beside it, in the configuration's "OpenNI2 library". Restart ARCx after changing it.

USB

The Structure Sensor and the PS1080 sensors work best on USB 2 ports. If one connects but sends no frames on a USB 3 port, edit OpenNI2/Drivers/PS1080.ini in the skill's install folder and set UsbInterface=2 under [Device].

The window

The Structure Sensor window, depth view

  • Start / Stop opens and closes the sensor. Sensor chooses which one, or the simulated one; the refresh button looks again.
  • 3D scan merges the next frames into one point cloud and saves it (below). Snapshot saves just the next frame. Record records everything the sensor streams to a .oni file until you press it again. Projector turns the infrared laser projector on and off.
  • The readouts: frames a second, how much of the picture has depth, the distance to whatever the middle of the picture sees, the nearest obstacle and drop, what is sent to the NMS, the paired camera, and the last scan.
  • The picture: the infrared camera (or a sensor's colour camera), or the depth coloured near to far. The detection area, when it is smaller than the whole picture, is outlined in pink.
  • The scan view: a top-down view of the robot (the orange triangle), what the sensor can see (the blue lines), the nearest obstacle in each degree (green, joined along surfaces), drops in the floor (purple), and the obstacle zone (orange, red with something in it). The mouse wheel zooms; a click says how far away the nearest thing is in that direction.

The infrared view

The infrared camera is the camera the depth is made from, so its picture lines up with the depth: a face, glyph or object found on the "Structure Sensor Infrared" video source gets its distance measured. It sees in the dark, with the projector's dot pattern sprinkled over everything.

3D scanning

A 3D scan of the simulator's desk, coloured from a paired camera

A single depth frame has holes and a little noise. A 3D scan takes many frames (30 is one second) and merges them: every point is dropped into a little cube (4 mm by default), every cube that enough frames saw becomes one point (the average of everything that landed in it), and the result is saved as a binary .ply file that MeshLab, CloudCompare, Blender and Open3D open. Mesh it in MeshLab (Screened Poisson) for a 3D printer.

  • Scanning an object: put it on a desk, aim the sensor at it from 50 to 100 cm, turn on "Only inside a box" in the 3D scanning tab with the box's centre at the object's distance, and keep everything still while it scans. Close range mode helps with small objects.
  • Scanning a room: choose World coordinates, a bigger cube (10 to 30 mm) and "Seen by at least" 1, and take scans as the robot drives about. Each point is placed where the Navigation Messaging System says the robot is, so the scans line up in one model of the room, as well as the robot's position reporting is.
  • Colour: with a paired colour camera the scan is in colour; otherwise it is grey from the infrared picture.

Scans go to My Documents/ARCx Data/Structure Sensor unless the 3D scanning tab says otherwise. The 3D scan button, the Scan3D control command, the scan_3d MCP tool and the Custom UI widget all take one.

Pairing a colour camera

Color Tracking on the paired camera, the red ball measured by the Structure Sensor

The Structure Sensor has no colour camera of its own; on an iPad it uses the iPad's. On a robot, mount any ARCx camera (a USB webcam or an EZ-B camera) close beside the sensor, facing the same way, and choose its video source in the Colour camera tab with its field of view and where its lens is relative to the depth lens. The skill then re-draws the depth as that camera sees it, which means:

  • every face, colour, glyph and object detection a vision skill makes on that camera gets its measured distance and position, through a second depth sensor named "Structure Sensor Paired" (Vision Detection Tracking Script puts them in its Object variables: ObjectDistance, ObjectForwardM, ObjectLeftM, ObjectHeightM);
  • 3D scans and snapshots come out in colour.

The better the field of view and the offset are measured, the better the colours sit on the shapes. The two cameras' frames are not taken at exactly the same moment, so pair them on a robot that is standing still for scans.

Recording and playback

Record writes everything the sensor streams (depth and the picture) to an OpenNI .oni file, the format NiViewer and every OpenNI2 program read. To play one back, choose the Recording driver and the file in the Sensor tab, or send PlayRecording from a script: navigation, the obstacle zone, 3D scans and measured detections all run on the recording as if it were the sensor, which makes it easy to tune a project at your desk with data from the robot. A recording made by the simulator grows by about 10 MB a second (OpenNI2 compresses a real sensor's depth losslessly, so less) at 320 x 240 with the infrared picture.

The simulator records too, so recordings work without a sensor.

How the obstacle scan is made

Every depth pixel is placed in the robot's frame from where the sensor is mounted: how far ahead, how far to the left, how high off the floor, and how far it is tilted down. With the mount height set, anything lower than the lowest obstacle height is the floor and is dropped, anything higher than the highest obstacle height (a table top the robot passes under, the ceiling) is dropped too, and the nearest of what is left in each slice of the view becomes the scan. Points seen below the floor are drops (stairs going down, a ledge), reported where the floor ends. Without a mount height the skill cannot tell the floor from an obstacle and reports everything inside the detection area, like a lidar.

The Structure Sensor sees from about 40 cm (35 cm in close range mode) to about 3.5 m across 58 degrees, and its depth error grows with the square of the distance. Give a robot a bumper or an ultrasonic sensor for the last 40 cm.

Configuration

Sensor

Sensor tab

Setting What it does
Driver Automatic, OpenNI2 (a live sensor), Recording (a .oni file) or Simulator.
Sensor Which sensor, when there is more than one.
Recording to play, Repeat the recording, Playback speed The .oni file the Recording driver plays, whether it starts again at its end, and how fast.
Simulated scene The simulator's room (a box, a table, a stairwell going down, a person walking across), corridor, or desk with a ball, a box and a can to 3D scan.
Simulate a colour camera The simulator also draws a colour camera beside the sensor, as the video source "Structure Sensor Simulated Color", to try pairing.
Start when the project loads Open the sensor as soon as the project has loaded.
Reconnect automatically, Reconnect every, Lost after Keep trying when the sensor is unplugged or cannot be opened.
OpenNI2 library Another OpenNI2 to use instead of the shipped one (needed on macOS). Needs ARCx restarted.

Streams

Streams tab

Setting What it does
Depth size, Frames a second QVGA (320 x 240, up to 60 frames a second) or VGA (640 x 480). The sensor offers the closest it has.
Picture, Picture size Infrared, Colour (a sensor with a colour camera) or Off, and its size.
Infrared auto contrast Stretches the infrared picture's brightness to what it sees.
Mirror the pictures Flips the pictures like a mirror. The depth used for navigation is always turned back; detections on a mirrored picture are not measured.
Projector on The infrared laser projector. Depth needs it. Turn it off to stop two sensors disturbing each other, or to see by an infrared lamp alone.
Close range mode Sees nearer things at the cost of some range.
Hole filter The sensor's own filling of small gaps in the depth.
Align depth to colour, Depth and colour in step, Colour auto exposure, Colour auto white balance For a sensor with a colour camera (Xtion Pro Live, Carmine).
Ignore closer than, Ignore further than Depth outside this range is dropped.

Colour camera

Colour camera tab

The camera to pair, its horizontal field of view, where its lens is relative to the Structure Sensor's depth lens (the left of its two lenses seen from behind; right and down are positive, as the sensor looks out), and whether its detections are measured.

Mounting

Mounting tab

Where the sensor sits, measured from the point on the floor below where the robot turns: height off the floor (to its lenses), how far it is tilted down, forward and left of that point, which way it faces, and its roll (180 for a sensor mounted upside down).

Navigation tab

Setting What it does
Publish to the NMS, Scans per second Send the scan to the navigation messaging system, at most this often.
Resolution Degrees per reading.
Nearest, Furthest The scan's range along the floor.
Lowest obstacle, Highest obstacle What counts as an obstacle when the mount height is set.
Detection area The part of the depth picture the scan is made from, in percent: left, top, width and height.
Find drops, Drop deeper than, Look for drops within, Drops are obstacles Drop detection, and whether drops go to the NMS as obstacles so a navigator steers round them.
Position placeholder A navigator only takes scans when the robot's position is reported. With nothing else reporting one, the skill repeats the last known position after each scan, and stands aside when another skill reports positions.

Obstacle zone

Obstacle zone tab

Watch the area straight ahead: anything closer than the distance inside the zone's width is an obstacle. The skill can stop the robot, pause a navigation and carry on once the zone is clear, and run a script when something appears and another when the zone is clear again. The ObstacleDistance and ObstacleAngle variables say where it was.

3D scanning

3D scanning tab

Setting What it does
Frames per scan How many frames are merged.
Cube size The size of the cubes points are merged into: 2 to 5 mm for an object, 10 to 30 mm for a room.
Seen by at least A cube is kept only when this many frames saw it, which removes stray readings.
Coordinates Robot (from the robot's centre on the floor), World (the room's, following the robot's position) or Sensor (the sensor's own optical frame, +X right, +Y down, +Z out of the lens).
Only inside a box, Box centre distance / size Keep only what is inside a box in front of the sensor.
Leave out the floor Drop the floor from Robot and World scans (needs the mount height).
In colour Colour from the paired camera or a sensor's colour camera, else grey from the infrared picture.
Save folder Where scans, snapshots and recordings go.

Video & variables

Video and variables tab

The video sources are named after the window title: "Structure Sensor Infrared" (or "Structure Sensor Color" on a sensor with a colour camera) and "Structure Sensor Depth". The depth colours can be Jet, Turbo, Inferno, Viridis, Rainbow or Bone. Measure detections gives every detection on the infrared (or registered colour) video its distance and position.

Global variables

With the prefix Structure (change it for a second sensor), distances in metres and angles in radians counter-clockwise from straight ahead (positive is left):

Variable Value
$StructureIsRunning True while streaming
$StructureNearestDistance, $StructureNearestAngle The nearest obstacle
$StructureFrontDistance Nearest within 10 degrees of straight ahead
$StructureLeftDistance, $StructureRightDistance Nearest 10 to 30 degrees to either side
$StructureCenterDistance Straight-line distance to what the middle of the picture sees
$StructureCliff, $StructureCliffDistance, $StructureCliffAngle A drop in the floor
$StructureObstacle, $StructureObstacleDistance, $StructureObstacleAngle The obstacle zone
$StructureEmitter The projector is on
$StructureIsRecording Recording to a .oni file
$StructureIsScanning, $StructureScanProgress, $StructureLastScanFile, $StructureLastScanPoints 3D scans
$StructureFPS, $StructureValidPercent Frame rate and how much of the picture has depth

Scripts, AI and the Custom UI

Scripts reach everything through control commands: distances in any direction or sector, a point of the picture measured in the robot's frame, the projector, close range, the detection area, snapshots, 3D scans, recordings and playback, and the list of sensors. For example, in JavaScript:

// Scan whatever is on the desk in front of the robot, then say how big the file is
var file = controlCommand("Structure Sensor", "Scan3D", 60, "desk");
Audio.say("Scanned " + getVar("$StructureLastScanPoints") + " points");

// Stop when something is closer than 60 centimetres ahead
if (getVar("$StructureFrontDistance") > 0 && getVar("$StructureFrontDistance") < 0.6)
  Movement.stop();

AI clients connected to ARCx's MCP server get five tools: the sensor's status with a sector summary of what it sees, measuring a point of the picture, saving a snapshot, taking a 3D scan, and capturing a small point cloud returned straight to the AI (in centimetres in the robot's frame) so it can reason about the shapes in front of the robot.

The Structure Sensor widgets on a Custom UI screen

The Structure Sensor view widget puts the depth or infrared picture, or the top-down scan, on your own Custom UI screens with a start/stop button, a 3D scan button and the nearest distance.

The simulator

Choose the Simulator driver (or the simulated sensor in the window's list) to use the skill without a sensor. It ray-casts a room, a corridor or a desk from where the Mounting tab says the sensor is, with the Structure Sensor's field of view, the projector's speckle on the infrared picture and a working projector switch, and can draw a paired colour camera. Everything above it (the scan, navigation, the obstacle zone, 3D scans, recordings, measured detections, the widget) runs exactly as with a sensor. For the desk scene, mount the sensor about 100 cm high, tilted 25 degrees down.

One sensor, one robot skill

A sensor can be opened by one program, and one robot skill, at a time. The depth this skill shares through ARCx (the depth sensor, the scan, the video sources and the measured detections) is available to every other skill in the project without opening the sensor again.

Troubleshooting

  • No sensor found (Windows): install OpenNI 2.2 for Windows x64 from structure.io/openni for the PrimeSense driver, plug the sensor in again, and check Device Manager lists it under PrimeSense. The Structure Sensor needs its USB hacker cable; the iPad connector cannot reach a computer.
  • No sensor found (Linux): install the udev rule from the Sensor tab and replug the sensor.
  • OpenNI2 did not load: on Linux, sudo apt install libopenni2-0; on macOS, see Setting up the sensor.
  • Connects but no frames: try a USB 2 port, or set UsbInterface=2 in PS1080.ini (Setting up the sensor, USB).
  • No depth at all: the projector is off (the window's projector button), or the sensor faces sunlight, which drowns its dots.
  • The floor shows as obstacles: set the mount height and tilt, and check the lowest obstacle height. Without a mount height, narrow the detection area to a band at the robot's height.
  • Scans are noisy or have stray points: raise "Seen by at least", keep the sensor still, or use a box around the object.
  • Colours sit beside the shapes: measure the paired camera's field of view and lens offset again.

About the Structure Core

The Structure Core is not an OpenNI2 device. It needs Occipital's (now XRPro's) Structure SDK (Cross-Platform), which is C++ only (its STCaptureSession class) and is only given to registered developers at developer.structure.io, so it cannot be shipped with or called from this skill directly. The skill is built so a Structure Core can be added as one more driver: a small C library that wraps STCaptureSession (open the sensor, wait for the next depth frame, copy its millimetre depth and intrinsics, the infrared or colour frame and the IMU, close), built for each platform against the SDK. If you have the SDK and want that driver, contact Synthiam.


Control Commands for the Structure Sensor robot skill

There are Control Commands available for this robot skill which allows the skill to be controlled programmatically from scripts or other robot skills. These commands enable you to automate actions, respond to sensor inputs, and integrate the robot skill with other systems or custom interfaces. If you're new to the concept of Control Commands, we have a comprehensive manual available here that explains how to use them, provides examples to get you started and make the most of this powerful feature.

Control Command Manual

This robot skill has 22 control commands, listed below. Send them from a JavaScript or Python script, from Blockly, or from another robot skill.

The first value is always the window title, which is the name in the title bar of the robot skill on your workspace. It starts out as Structure Sensor, which is what every example below uses. If you rename the robot skill, or add a second copy of it to the project, use the title as it appears on that window instead.

ControlCommand() can be shortened to CC(), and both spellings work in JavaScript and in Python. The examples are JavaScript; Python is the same call, except that true and false are written True and False.

GetCenterDistance

The straight-line distance in metres from the sensor to whatever the middle of its picture sees. 0 when there is no reading there.

Syntax

ControlCommand("Structure Sensor", "GetCenterDistance")

Returns: Float [1.5e45 to 3.4e38]

Example

var result = ControlCommand("Structure Sensor", "GetCenterDistance");

GetDeviceInfo

The sensor, the driver that opened it, its streams and what this computer has for it.

Syntax

ControlCommand("Structure Sensor", "GetDeviceInfo")

Returns: String

Example

var result = ControlCommand("Structure Sensor", "GetDeviceInfo");

GetDistance

The distance in metres along the floor from the robot's centre to the nearest obstacle in a direction, from the latest depth scan. angle is in radians counter-clockwise from straight ahead (0 ahead, positive left, negative right). 0 when nothing is seen there or the direction is outside the sensor's 58 degree view.

Syntax

ControlCommand("Structure Sensor", "GetDistance", (Number)angle)

Parameters

# Name Type What to pass
1 angle Number A number, without quotes

Returns: Float [1.5e45 to 3.4e38]

Example

var result = ControlCommand("Structure Sensor", "GetDistance", 0);

GetDistanceAtPixel

The straight-line distance in metres from the sensor to what a point of the depth picture sees. x and y are fractions of the picture's width and height from the top left (0.5, 0.5 is the middle). 0 when there is no reading there.

Syntax

ControlCommand("Structure Sensor", "GetDistanceAtPixel", (Number)x, (Number)y)

Parameters

# Name Type What to pass
1 x Number A number, without quotes
2 y Number A number, without quotes

Returns: Float [1.5e45 to 3.4e38]

Example

var result = ControlCommand("Structure Sensor", "GetDistanceAtPixel", 0, 0);

GetNearest

The nearest obstacle the sensor sees as [distance in metres along the floor, direction in radians counter-clockwise from straight ahead]. [0, 0] when nothing is seen.

Syntax

ControlCommand("Structure Sensor", "GetNearest")

Returns: Array of Float

Example

var result = ControlCommand("Structure Sensor", "GetNearest");

GetPointAtPixel

Where the thing a point of the depth picture sees is, as [forward, left, height] in metres from the robot's centre on the floor (+forward ahead, +left to the robot's left, height off the floor). x and y are fractions of the picture from the top left. [0, 0, 0] when there is no reading there.

Syntax

ControlCommand("Structure Sensor", "GetPointAtPixel", (Number)x, (Number)y)

Parameters

# Name Type What to pass
1 x Number A number, without quotes
2 y Number A number, without quotes

Returns: Array of Float

Example

var result = ControlCommand("Structure Sensor", "GetPointAtPixel", 0, 0);

GetSectorDistance

The distance in metres to the nearest obstacle between two directions, going counter-clockwise from startAngle to endAngle, in radians from straight ahead (-0.35 to 0.35 is the 40 degrees around straight ahead). 0 when nothing is seen there.

Syntax

ControlCommand("Structure Sensor", "GetSectorDistance", (Number)startAngle, (Number)endAngle)

Parameters

# Name Type What to pass
1 startAngle Number A number, without quotes
2 endAngle Number A number, without quotes

Returns: Float [1.5e45 to 3.4e38]

Example

var result = ControlCommand("Structure Sensor", "GetSectorDistance", 0, 0);

IsCliffDetected

Whether the sensor sees a drop in the floor (stairs, a ledge) right now. Needs drop detection turned on and the mount height set.

Syntax

ControlCommand("Structure Sensor", "IsCliffDetected")

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "IsCliffDetected");

IsObstacleDetected

Whether something is inside the obstacle zone right now. Always false when the obstacle zone is turned off.

Syntax

ControlCommand("Structure Sensor", "IsObstacleDetected")

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "IsObstacleDetected");

IsRunning

Whether the skill is running (connecting, streaming or waiting to reconnect).

Syntax

ControlCommand("Structure Sensor", "IsRunning")

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "IsRunning");

ListSensors

The sensors OpenNI2 sees on this computer, plus the simulator: one "name [uri]" per item. The uri goes in the configuration's DeviceUri.

Syntax

ControlCommand("Structure Sensor", "ListSensors")

Returns: Array of String

Example

var result = ControlCommand("Structure Sensor", "ListSensors");

PlayRecording

Play a .oni recording instead of the sensor (switches the driver to Recording and restarts): everything (navigation, scans, detections) runs on the recording as if it were live. filename is a full path, or a file in the save folder. Returns true.

Syntax

ControlCommand("Structure Sensor", "PlayRecording", (String)filename)

Parameters

# Name Type What to pass
1 filename Text Your text, in quotes

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "PlayRecording", "filename");

SavePointCloud

Save the next depth frame as a 3D point cloud (.ply, opens in MeshLab, CloudCompare, Blender), in metres in the robot's frame, coloured when a picture lines up with the depth. filename is optional: empty saves a dated file in the save folder. Returns the file's full path.

Syntax

ControlCommand("Structure Sensor", "SavePointCloud", (String)filename)

Parameters

# Name Type What to pass
1 filename Text Your text, in quotes

Returns: String

Example

var result = ControlCommand("Structure Sensor", "SavePointCloud", "filename");

Scan3D

Take a 3D scan: merge the next frames (0 uses the configured count, 30 is a second) into one dense point cloud and save it as a .ply file, with the 3D scanning tab's settings (cube size, the box to keep, coordinates, colour). Waits until it is saved. filename is optional. Returns the file's full path.

Syntax

ControlCommand("Structure Sensor", "Scan3D", (Number)frames, (String)filename)

Parameters

# Name Type What to pass
1 frames Number A number, without quotes
2 filename Text Your text, in quotes

Returns: String

Example

var result = ControlCommand("Structure Sensor", "Scan3D", 0, "filename");

SetCloseRange

Turn close range mode on or off (the PS1080 sees nearer things at the cost of some range). Returns the new setting.

Syntax

ControlCommand("Structure Sensor", "SetCloseRange", (Bool)on)

Parameters

# Name Type What to pass
1 on True or false true or false, without quotes

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "SetCloseRange", true);

SetDetectionArea

Set the detection area (the part of the depth picture the obstacle scan is made from) in percent of the picture: left, top, width and height. 0, 0, 100, 100 is the whole picture.

Syntax

ControlCommand("Structure Sensor", "SetDetectionArea", (Number)left, (Number)top, (Number)width, (Number)height)

Parameters

# Name Type What to pass
1 left Number A number, without quotes
2 top Number A number, without quotes
3 width Number A number, without quotes
4 height Number A number, without quotes

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "SetDetectionArea", 0, 0, 0, 0);

SetEmitter

Turn the sensor's infrared projector on or off. Depth needs it on; off, the infrared camera sees only by other light, and two sensors stop disturbing each other. Returns the new setting.

Syntax

ControlCommand("Structure Sensor", "SetEmitter", (Bool)on)

Parameters

# Name Type What to pass
1 on True or false true or false, without quotes

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "SetEmitter", true);

SetPublishToNMS

Turn sending the depth scan to the Navigation Messaging System on or off. Returns the new setting.

Syntax

ControlCommand("Structure Sensor", "SetPublishToNMS", (Bool)publish)

Parameters

# Name Type What to pass
1 publish True or false true or false, without quotes

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "SetPublishToNMS", true);

Start

Open the sensor (or play the recording, or start the simulator) and start streaming. Returns false if it was already running.

Syntax

ControlCommand("Structure Sensor", "Start")

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "Start");

StartRecording

Record everything the sensor streams (depth and the picture) to an OpenNI .oni file until StopRecording, without stopping the sensor. Play it back with PlayRecording, NiViewer or any OpenNI2 program. filename is optional: empty saves a dated file in the save folder. Returns the file's full path.

Syntax

ControlCommand("Structure Sensor", "StartRecording", (String)filename)

Parameters

# Name Type What to pass
1 filename Text Your text, in quotes

Returns: String

Example

var result = ControlCommand("Structure Sensor", "StartRecording", "filename");

Stop

Stop streaming and close the sensor. A recording in progress is finished and saved. Returns false if it was not running.

Syntax

ControlCommand("Structure Sensor", "Stop")

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "Stop");

StopRecording

Stop recording and save the file. Returns false when nothing was being recorded.

Syntax

ControlCommand("Structure Sensor", "StopRecording")

Returns: Boolean [true or false]

Example

var result = ControlCommand("Structure Sensor", "StopRecording");

This list is read out of the robot skill itself each time its package is uploaded, so it matches the published version (v2).


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

#2  

This robot skill has been updated to v2.

What has changed

updated to use some new ARCx UI features for improved performance.