Compile
Install the Qt5 Core and Network components. Installation commands vary by Linux distribution; the following example uses Ubuntu: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
Fromhome/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’sx, 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 asstd_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 asstd_msgs::String on LxCamera_Module_Error.
Receive mapping status
After mapping starts, ROS publishes the mapping status asstd_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 astd_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 astd_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
- Publish
nav_msgs::Odometrydata to/sim/odom(the topic can be changed).
Download the contour map
- Publish a
std_msgs/Stringmessage toLxCamera_DownloadMap. - The message contains an absolute host path and a map name, separated by a comma. The map name is the
.zipfile name of a completed map on the camera. - After a successful download, the specified host path contains the map archive. Extract it to obtain a
PGMmap file and aYAMLconfiguration file.
Upload a map ZIP file (new)
- Publish a
std_msgs/Stringmessage toLxCamera_UploadMapZip. - 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. - If the map is found, the SDK sends it to the camera. The camera extracts it to
/home/fr1511b/hontai/map/.
Relocalize
- Publish
geometry_msgs::PoseWithCovarianceStampeddata toLxCamera_UploadReloc. - The pose contains the LiDAR pose:
x,y, andyaw. - 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 anEuler yawangle to quaternionxyzwvalues.
ROS service interfaces
Mapping, map switching, map downloading, and relocalization are also available through ROS services. A service response oftrue 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:
Switch maps
Service name:/lx_localization_node/LxCamera_SwitchMap_srv
Service definition:
Download a map
Service name:/lx_localization_node/LxCamera_DownloadMap_srv
Service definition:
Relocalize
Service name:/lx_localization_node/LxCamera_UploadReloc_srv
Service definition:
Get the current map name
Service name:/lx_localization_node/LxCamera_GetCurMapname_srv
Service definition:
Get the current map list
Service name:/lx_localization_node/LxCamera_GetMapList_srv
Service definition:
Exit mapping (custom interface)
Service name:/lx_localization_node/LxCamera_ExitMapping_srv
Service definition:
Delete a map
Service name:/lx_localization_node/LxCamera_EraseMap_srv
Service definition:
Download a heat map
Service name:/lx_localization_node/LxCamera_DownloadMap_srv
Service definition:
Incremental mapping
Service name:/lx_localization_node/LxCamera_IncMapping_srv
Service definition: