Remote Mode
Remote mode is used when a sensor is connected to a compute unit. The development computer accesses the compute-unit service over the network and creates a remote Sensor instance using the sensor serial number and the compute unit's mac_addr.
Prerequisites
- Connect the sensor to the compute unit and verify that the sensor service is running on the compute unit.
- Ensure that the development computer can reach the compute unit and discover its EzROS/DDS services.
- Obtain the compute unit's master service name. It normally follows the format
master_{mac_addr}, for examplemaster_000000000000. Replace it with the actual service name when connecting. - Install
xensesdk[viz]to run the remote example with its visualization interface.
The IP address is used for network connectivity and device discovery; it is not a direct argument to Sensor.create(). To create a remote sensor, pass the mac_addr portion of the master service name.
Using the ezros CLI
Installing the XenseSDK Python Wheel also provides the ezros command-line tool. It can scan EzROS nodes, show Xense master version and sensor information, call services, and monitor basic topics.
- When configuring remote mode, run
ezros -ato list all nodes, orezros -ito quickly verify the master service and connected sensors. - Run
ezros service -n master_{mac_addr} -c scan_sensor_snto test the sensor-query service directly. - Run
ezros --helpto see the complete parameter reference.
Find remote sensors
Call the master service's scan_sensor_sn action to list sensors connected to the compute unit:
from xensesdk import call_service
master_service = "master_000000000000" # Replace with the actual service name
serial_map = call_service(
master_service,
"scan_sensor_sn",
timeout_sec=1,
)
if not serial_map:
raise RuntimeError("No remote sensor found")
print(serial_map)
The result contains the available sensor serial numbers. If multiple sensors are connected, select the required serial number instead of assuming that the first item is the target sensor.
Create a remote sensor
Extract mac_addr from the master service name and pass it to Sensor.create() with the target sensor serial number:
from xensesdk import Sensor
serial_number = "OG000001" # Replace with the target serial number from serial_map
mac_addr = master_service.split("_", 1)[1]
sensor = Sensor.create(serial_number, mac_addr=mac_addr)
Read data
A remote instance uses the same selectSensorInfo() interface as a local instance:
from time import sleep
try:
while True:
rectify, depth = sensor.selectSensorInfo(
Sensor.OutputType.Rectify,
Sensor.OutputType.Depth,
)
print("rectify:", rectify.shape, "depth:", depth.shape)
sleep(0.02)
except KeyboardInterrupt:
pass
finally:
sensor.release()
If call_service() returns no result, check the master service name, compute-unit service status, and network connectivity. Service names and actions are provided by the compute-unit firmware; use EzROS to inspect available services before calling other remote actions.