Skip to content

Commit

Permalink
- readme extended for topics and separated/new file docs/topics.md added
Browse files Browse the repository at this point in the history
- pf_description and pf_driver -> 2.0.0
  • Loading branch information
JnsHndr committed Nov 11, 2024
1 parent a852e7f commit 9478425
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ turn. This is not strictly from bottom to top:
|2 |+4.5° | top |
|3 |+1.5° | - |

**Topics:**
The R2000 and R2300 devices each publish two topics. See the topics documentation [topics.md](./docs/topics.md) for more details.

**Services:**
The ROS driver offers several ROS services which can be used to communicate with the sensor. Especially
services for sensor parametrization are available. For example to list, get and set parameters. See the
Expand Down
33 changes: 33 additions & 0 deletions docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,36 @@ and reboots the device.
```
ros2 service call /pf_r2000/pfsdp_factory_reset pf_interfaces/srv/PfsdpFactoryReset
```

## Service type and interface:
The service type determines which data is used for the request and response of a service. The following command is an
example for determining the type of the pfsdp_set_parameter service:
```
ros2 service type /pf_r2000/pfsdp_set_parameter
```
The return should be the following. Which is also the path to the file where the request and response data is described in detail:
```
pf_interfaces/srv/PfsdpSetParameter
```
To show the request and response interface/data for the pfsdp_set_parameter service the following command can be used:
```
ros2 interface show pf_interfaces/srv/PfsdpSetParameter
```
The return should be the following and shows the data name and type of the request above and of the response below the three dashes.
```
string name
string value
- - -
int32 error_code
string error_text
```

## Service execution status
All previously described services return at least the error code (error_code) and error text (error_text) in the response.
Both contain the status of the service execution. Error codes (data type int32) not equal to 0 indicate an error during service
execution. Error text (data type string) shows the status of the service execution as a description readable by humans.
The following response of the service pfsdp_set_parameter shows the error code, error text and as first return value
the read parameter user_tag.
```
pf_interfaces.srv.PfsdpGetParameter_Response(value='OMD10M-R2000', error_code=0, error_text='success')
```
117 changes: 117 additions & 0 deletions docs/topics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
## ROS Topics

**R2000 & R2300 1-layer:**

| Topic | Type | Description |
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| /pf/scan | LaserScan | ROS standard message, see [sensor_msgs/LaserScan](https://docs.ros.org/en/jazzy/p/sensor_msgs/interfaces/msg/LaserScan.html) |
| /r2000_header | PFR2000Header | Sensor specific message, see [pf_interfaces/msg/PFR2000Header.msg] (../src/pf_interfaces/msg/PFR2000Header.msg) |

Topic PFR2000Header details:

| Type | Name | Description |
| ------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| uint16 | magic | magic byte (0xa25c) marking the beginning of a packet |
| uint16 | packet_type | scan data packet type (0x0041 - 'A' 0x0042 - 'B' 0x0043 - 'C') |
| uint32 | packet_size | overall packet size in bytes (header + payload) |
| uint16 | header_size | header size in bytes (offset to payload data) |
| uint16 | scan_number | sequence number for scan (incremented for every scan, starting with 0, overflows) |
| uint16 | packet_number | sequence number for packet (counting packets of a particular scan, starting with 1) |
| | | |
| uint64 | timestamp_raw | raw timestamp of first scan point in this packet in NTP time format |
| uint64 | timestamp_sync | synchronized timestamp of first scan point in this packet in NTP time format (currenty not available and and set to zero) |
| uint32 | status_flags | scan status flags |
| uint32 | scan_frequency | frequency of head rotation (1/1000Hz) |
| uint16 | num_points_scan | number of scan points (samples) within complete scan |
| uint16 | num_points_packet | total number of scan points within this packet |
| uint16 | first_index | index of first scan point within this packet |
| int32 | first_angle | absolute angle of first scan point within this packet (1/10000°) |
| int32 | angular_increment | delta between two succeding scan points (1/10000°) CCW rotation: +ve, CW rotation: -ve |
| uint32 | iq_input | reserved - all bits zero for devices without switching I/Q |
| uint32 | iq_overload | reserved - all bits zero for devices without switching I/Q |
| uint64 | iq_timestamp_raw | raw timestamp for status of switching I/Q |
| uint64 | iq_timestamp_sync | synchronized timestamp for status of switching I/Q |

status_flags details:

| Bit | Flag name | Description |
| --------------- |--------------------------- | --------------------------------------------------------------------------------- |
| *Informational* | | |
| 0 | scan_data_info | Accumulative flag – set if any informational flag (bits 1..7) is set |
| 1 | new_settings | System settings for scan data acquisition changed during recording of this packet |
| 2 | invalid_data | Consistency of scan data is not guaranteed for this packet |
| 3 | unstable_rotation | Scan frequency did not match set value while recording this scan data packet |
| 4 | skipped_packets | Preceding scan data packets have been skipped due to connection issues |
| *Warnings* | | |
| 8 | device_warning | Accumulative flag – set if any warning flag (bits 9..15) is set |
| 9 | lens_contamination_warning | LCM warning threshold triggered for at least one sector |
| 10 | low_temperature_warning | Current internal temperature below warning threshold |
| 11 | high_temperature_warning | Current internal temperature above warning threshold |
| 12 | device_overload | Overload warning – sensor CPU overload is imminent |
| *Errors* | | |
| 16 | device_error | Accumulative flag – set if any error flag (bits 17..23) is set |
| 17 | lens_contamination_error | LCM error threshold triggered for at least one sector |
| 18 | low_temperature_error | Current internal temperature below error threshold |
| 19 | high_temperature_error | Current internal temperature above error threshold |
| 20 | device_overload | Overload error – sensor CPU is in overload state |
| *Defects* | | |
| 30 | device_defect | Accumulative flag – set if device detected an unrecoverable defect |

**R2300 4-layer:**

| Topic | Type | Description |
| ------------- |-------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| /pf/cloud | PointCloud2 | ROS standard message, see [sensor_msgs/PointCloud2](https://docs.ros.org/en/jazzy/p/sensor_msgs/interfaces/msg/PointCloud2.html) |
| /r2300_header | PFR2300Header | Sensor specific message, see [pf_interfaces/msg/PFR2300Header.msg] (../src/pf_interfaces/msg/PFR2300Header.msg) |

Topic PFR2300Header details:

| Type | Name | Description |
| ------ | ----------------- | -------------------------------------------------------------------------------------- |
| uint16 | magic | magic byte (0xa25c) marking the beginning of a packet |
| uint16 | packet_type | scan data packet type (0x0041 - 'A' 0x0042 - 'B' 0x0043 - 'C') |
| uint32 | packet_size | overall packet size in bytes (header + payload) |
| uint16 | header_size | header size in bytes (offset to payload data) |
| uint16 | scan_number | sequence number for scan (incremented for every scan, starting with 0, overflows) |
| uint16 | packet_number | sequence number for packet (counting packets of a particular scan, starting with 1) |
| | | |
| uint16 | layer_index | vertical layer index (0..3) |
| int32 | layer_inclination | vertical layer inclination [1/10000 degree] |
| uint64 | timestamp_raw | raw timestamp of first scan point in this packet in NTP time format |
| uint64 | reserved1 | reserved - all bits zero for devices without switching I/Q |
| uint32 | status_flags | scan status flags |
| uint32 | scan_frequency | frequency of head rotation (1/1000Hz) |
| uint16 | num_points_scan | number of scan points (samples) within complete scan |
| uint16 | num_points_packet | total number of scan points within this packet |
| uint16 | first_index | index of first scan point within this packet |
| int32 | first_angle | absolute angle of first scan point within this packet (1/10000°) |
| int32 | angular_increment | delta between two succeding scan points (1/10000°) CCW rotation: +ve, CW rotation: -ve |

status_flags details:

| Bit | Flag name | Description |
| --------------- |--------------------------- | --------------------------------------------------------------------------------- |
| *Informational* | | |
| 0 | scan_data_info | Accumulative flag – set if any informational flag (bits 1..7) is set |
| 1 | new_settings | System settings for scan data acquisition changed during recording of this packet |
| 2 | invalid_data | Consistency of scan data is not guaranteed for this packet |
| 3 | unstable_rotation | Scan frequency did not match set value while recording this scan data packet |
| 4 | skipped_packets | Preceding scan data packets have been skipped due to connection issues |
| *Warnings* | | |
| 8 | device_warning | Accumulative flag – set if any warning flag (bits 9..15) is set |
| 10 | low_temperature_warning | Current internal temperature below warning threshold |
| 11 | high_temperature_warning | Current internal temperature above warning threshold |
| 12 | device_overload | Overload warning – sensor CPU overload is imminent |
| *Errors* | | |
| 16 | device_error | Accumulative flag – set if any error flag (bits 17..23) is set |
| 18 | low_temperature_error | Current internal temperature below error threshold |
| 19 | high_temperature_error | Current internal temperature above error threshold |
| 20 | device_overload | Overload error – sensor CPU is in overload state |
| *Defects* | | |
| 30 | device_defect | Accumulative flag – set if device detected an unrecoverable defect |






3 changes: 3 additions & 0 deletions src/pf_description/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Changelog for package pf_description
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.0.0 (2024-11-xx)
------------------

1.3.0 (2024-09-17)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion src/pf_description/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>pf_description</name>
<version>1.3.0</version>
<version>2.0.0</version>
<description>The pf_description package</description>

<maintainer email="harshavardhan.deshpande@ipa.fraunhofer.de">Harsh Deshpande</maintainer>
Expand Down
5 changes: 5 additions & 0 deletions src/pf_driver/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package pf_driver
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.0.0 (2024-11-xx)
------------------
* ROS/sensor parameters replaced by ROS services (pfsdp_get_parameter & pfsdp_set_parameter)
* add more ROS services -> pfsdp_list_parameters, pfsdp_reset_parameter, pfsdp_get_protocol_info etc.

1.3.0 (2024-09-17)
-------------------
* fix driver build errors under ROS Jazzy `#12 <https://github.com/PepperlFuchs/pf_lidar_ros2_driver/issues/12>`_
Expand Down
2 changes: 1 addition & 1 deletion src/pf_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>pf_driver</name>
<version>1.3.0</version>
<version>2.0.0</version>
<description>The Pepperl+Fuchs LiDAR package</description>

<maintainer email="harshavardhan.deshpande@ipa.fraunhofer.de">Harsh Deshpande</maintainer>
Expand Down

0 comments on commit 9478425

Please sign in to comment.