Skip to main content

Compile

Install the Qt5 Core and Network components. Installation commands vary by Linux distribution; the following example uses Ubuntu:
Download and compile libzip from the libzip download page according to the official instructions. Compile the ROS package from /V2-ROS-SDK-service, which is at the same level as src:

Run

If ROS master/slave settings are enabled on the camera, disable them before running the ROS sample. After powering on the camera, wait about 20 seconds before starting the sample.
From home/username/V2_ROS_SDK, which is at the same level as src, run:

ROS topic interfaces

Before testing an interface, power on the camera and wait about 30 seconds for the built-in program to start. Then start the ROS SDK node.

Receive localization pose

ROS continuously receives the camera’s x, y, and theta values, publishes these values and the quaternion converted from theta to LxCamera_LocationPoseResult, and broadcasts the pose through TF.

Receive localization status

ROS receives the camera’s localization status (true or false) at 1 Hz and publishes it as std_msgs::Bool on LxCamera_LocationResult.

Receive camera storage usage

ROS receives the camera’s storage usage ratio at 2 Hz and publishes it as std_msgs::Float32 on LxCamera_Capacity_Status.

Receive the faulty module name

ROS receives the name of a faulty module from the camera and publishes it as std_msgs::String on LxCamera_Module_Error.

Receive mapping status

After mapping starts, ROS publishes the mapping status as std_msgs::Bool on LxCamera_MappingState.

Receive mapping progress

After mapping starts, ROS publishes the mapping progress (0–100) as std_msgs::Int32 on LxCamera_Mapping_Progress.

Set parameters

Publish a std_msgs/String message to LxCamera_SetParam. The message contains nine floating-point values separated by commas: x,y,z,yaw,pitch,roll,x,y,yaw. The first six values define the camera pose; the last three define the LiDAR pose. After a successful update, the corresponding values in the [Laser1] and [Camera1] sections of /home/fr1511b/hontai/params/config_install_FL21500HAF.ini are updated.

Switch maps

Publish a std_msgs/String message containing the name of a completed map to LxCamera_SwitchMap. Refresh the camera web interface. If the displayed map name changes, the switch succeeded.

Upload odometry

  1. Publish nav_msgs::Odometry data to /sim/odom (the topic can be changed).

Download the contour map

  1. Publish a std_msgs/String message to LxCamera_DownloadMap.
  2. The message contains an absolute host path and a map name, separated by a comma. The map name is the .zip file name of a completed map on the camera.
  3. After a successful download, the specified host path contains the map archive. Extract it to obtain a PGM map file and a YAML configuration file.

Upload a map ZIP file (new)

  1. Publish a std_msgs/String message to LxCamera_UploadMapZip.
  2. The message contains the path to the map archive to upload, for example /home/fr1511b/map.zip. Use an archive downloaded through the map download interface.
  3. If the map is found, the SDK sends it to the camera. The camera extracts it to /home/fr1511b/hontai/map/.

Relocalize

  1. Publish geometry_msgs::PoseWithCovarianceStamped data to LxCamera_UploadReloc.
  2. The pose contains the LiDAR pose: x, y, and yaw.
  3. Relocalization succeeds when the position shown in the camera web interface updates to the sent pose.
Quaternions are constrained and must not be filled in arbitrarily. Use the Euler-to-quaternion converter to convert an Euler yaw angle to quaternion xyzw values.

ROS service interfaces

Mapping, map switching, map downloading, and relocalization are also available through ROS services. A service response of true indicates success; false indicates failure. For operations that require confirmation, prefer the service interface.
Use rosservice call for the following commands. Map names must not start with a number and must be no longer than 30 characters.

Build a map

Service name: /lx_localization_node/LxCamera_Mapping_srv Service definition:
Call the service:

Switch maps

Service name: /lx_localization_node/LxCamera_SwitchMap_srv Service definition:
Call the service:

Download a map

Service name: /lx_localization_node/LxCamera_DownloadMap_srv Service definition:
Call the service:

Relocalize

Service name: /lx_localization_node/LxCamera_UploadReloc_srv Service definition:
Call the service:

Get the current map name

Service name: /lx_localization_node/LxCamera_GetCurMapname_srv Service definition:
Call the service:

Get the current map list

Service name: /lx_localization_node/LxCamera_GetMapList_srv Service definition:
Call the service:

Exit mapping (custom interface)

Service name: /lx_localization_node/LxCamera_ExitMapping_srv Service definition:
Call the service:

Delete a map

Service name: /lx_localization_node/LxCamera_EraseMap_srv Service definition:
Call the service:

Download a heat map

Service name: /lx_localization_node/LxCamera_DownloadMap_srv Service definition:
Call the service:

Incremental mapping

Service name: /lx_localization_node/LxCamera_IncMapping_srv Service definition:
Call the service: