Overview
This page describes the ROS2 topics and services provided bylx_camera_ros in the V2 localization module.
Compile
Install the Qt5 Core and Network components. Installation commands vary by Linux distribution; the following example uses Ubuntu:libzip source from the libzip download page and compile it according to the official instructions.
Run the following command from /lx_camera_ros:
Run
Recompile after changing the YAML configuration file. Changes do not take effect until the project is rebuilt.
ROS2 topic interfaces
Before testing an interface, power on the camera, wait about 30 seconds, and start the ROS2 SDK node.Receive localization pose
ROS2 continuously receives the camera’sx, y, and theta values, publishes the values and the quaternion converted from theta to LxCamera_LocationPoseResult, and broadcasts the pose through TF.
Receive localization status
ROS2 receives the camera’s localization status (true or false) at 1 Hz and publishes it as std_msgs::msg::Bool on LxCamera_LocationResult.
Receive camera storage usage
ROS2 receives the camera’s storage usage ratio at 2 Hz and publishes it asstd_msgs::msg::Float32 on LxCamera_Capacity_Status.
Receive the faulty module name
ROS2 receives the name of a faulty module from the camera and publishes it asstd_msgs::msg::String on LxCamera_Module_Error.
Receive mapping progress
After mapping starts, ROS2 publishes the progress (0–100) as std_msgs::msg::Int32 on LxCamera_Mapping_Progress.
Receive mapping status
After mapping starts, ROS2 publishes the mapping status asstd_msgs::msg::Bool on LxCamera_MappingState.
Set parameters
Publish astd_msgs::msg::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::msg::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.
Download a map
- Publish a
std_msgs::msg::Stringmessage toLxCamera_DownloadMap. - The message contains two fields:
save_path, an absolute path on the host computer, andmapname, 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 odometry
Publishnav_msgs::msg::Odometry data to /sim/odom (the topic can be changed).
Relocalize
- Publish
geometry_msgs::msg::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.
Message type prefixes
The host computer communicates with the camera over UDP. The first four bytes of each message identify the interface data type:ROS2 service interfaces
Mapping, map switching, map downloading, and relocalization are also available through ROS2 services. A service response oftrue indicates success; false indicates failure.
Use
ros2 service 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:/LxCamera_Mapping_srv
Service definition:
Switch maps
Service name:/LxCamera_SwitchMap_srv
Service definition:
Download a map
Service name:/LxCamera_DownloadMap_srv
Service definition:
Relocalize
Service name:/LxCamera_UploadReloc_srv
Service definition:
Get the current map name
Service name:/LxCamera_GetCurMapname_srv
Service definition:
Get the current map list
Service name:/LxCamera_GetMapList_srv
Service definition:
Exit mapping
Service name:/LxCamera_ExitMapping_srv
Service definition:
Delete a map
Service name:/LxCamera_EraseMap_srv
Service definition:
Download a heat map
Service name:/LxCamera_DownloadHeatMap_srv
Service definition:
Incremental mapping
Service name:/LxCamera_IncMapping_srv
Service definition: