15 Commits

Author SHA1 Message Date
marvin.li
3d240d5666 update LICENSE 2023-02-28 12:29:27 +08:00
Livox-SDK
880c46a91a Merge branch 'master' of https://github.com/Livox-SDK/livox_ros_driver 2021-07-24 11:46:59 +08:00
Livox-SDK
f08ce8763a feat:filter RMC packets from NMEA-0183 messages 2021-07-24 11:37:39 +08:00
livox
86350dc0c6 Update README_CN.md 2021-06-01 10:38:13 +08:00
livox
ff656eeba6 Update README.md
update support email to cs@livoxtech.com
2021-05-26 17:08:57 +08:00
livox
d05c784839 Merge pull request #79 from 3noch/patch-1
Bring printf into scope in timesync.cpp
2021-03-15 14:35:02 +08:00
Elliot Cameron
42bbd8218a Bring printf into scope in timesync.cpp
Slight changes in compilation order can cause the use of printf to fail without <cstdio> included.
2021-03-10 00:46:36 -05:00
livox
1d6e869a3e fix:change publisher queue size from 4 to 64
change publisher queue size from 4 to 64 in multitopic mode
2021-01-04 11:30:52 +08:00
livox
0d67ae9f9b Merge pull request #70 from taichiH/add-config-install
add config install setting
2020-12-18 19:21:24 +08:00
taichiH
abc1139833 add config install setting 2020-12-16 21:13:03 +09:00
Livox-SDK
286827827d feat:add lidar bag or imu bag parameter
1. fix corner case bug when covert lvx file to rosbag;
2. add lidar bag and imu bag parameter for the convertion of lvx file to rosbag;
2020-11-25 14:59:41 +08:00
Livox-SDK
12c709c0c9 feat:add INT signal handler for "Ctrl+C" exit 2020-11-02 17:40:00 +08:00
Livox-SDK
ac252afeb6 fix:fix display table error in readme 2020-10-27 10:48:12 +08:00
livox
aacca09493 Merge pull request #61 from kmiya/fix-copy-paste-error
Fix copy-paste error in timesync
2020-10-26 21:23:38 +08:00
Kazuki Miyahara
221be0adc7 fix copy-paste error in timesync 2020-10-23 16:49:37 +09:00
20 changed files with 193 additions and 552 deletions

View File

@@ -46,497 +46,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
=============================================================== ===============================================================
LIVOXs Livox SDK uses unmodified libraries of Apache Portable Runtime Library (APR)(https://github.com/apache/apr), which is licensed under Apache license. A copy of the Apache license is provided below and is also available at https://raw.githubusercontent.com/apache/apr/trunk/LICENSE.
-------------------------------------------------------------
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
APACHE PORTABLE RUNTIME SUBCOMPONENTS:
The Apache Portable Runtime includes a number of subcomponents with
separate copyright notices and license terms. Your use of the source
code for these subcomponents is subject to the terms and conditions
of the following licenses.
From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c,
file_io/unix/mktemp.c, strings/apr_strings.c:
/*
* Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
From network_io/unix/inet_ntop.c, network_io/unix/inet_pton.c:
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
From dso/aix/dso.c:
* Based on libdl (dlfcn.c/dlfcn.h) which is
* Copyright (c) 1992,1993,1995,1996,1997,1988
* Jens-Uwe Mager, Helios Software GmbH, Hannover, Germany.
*
* Not derived from licensed software.
*
* Permission is granted to freely use, copy, modify, and redistribute
* this software, provided that the author is not construed to be liable
* for any results of using the software, alterations are clearly marked
* as such, and this notice is not modified.
From strings/apr_strnatcmp.c, include/apr_strings.h:
strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
From strings/apr_snprintf.c:
*
* cvt - IEEE floating point formatting routines.
* Derived from UNIX V7, Copyright(C) Caldera International Inc.
*
Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code and documentation must retain the above
copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed or owned by Caldera
International, Inc.
Neither the name of Caldera International, Inc. nor the names of other
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT,
INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
For the include\apr_md5.h component:
* This is work is derived from material Copyright RSA Data Security, Inc.
*
* The RSA copyright statement and Licence for that original material is
* included below. This is followed by the Apache copyright statement and
* licence for the modifications made to that material.
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
For the passwd\apr_md5.c component:
* This is work is derived from material Copyright RSA Data Security, Inc.
*
* The RSA copyright statement and Licence for that original material is
* included below. This is followed by the Apache copyright statement and
* licence for the modifications made to that material.
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
* The apr_md5_encode() routine uses much code obtained from the FreeBSD 3.0
* MD5 crypt() function, which is licenced as follows:
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
For the crypto\apr_md4.c component:
* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
* rights reserved.
*
* License to copy and use this software is granted provided that it
* is identified as the "RSA Data Security, Inc. MD4 Message-Digest
* Algorithm" in all material mentioning or referencing this software
* or this function.
*
* License is also granted to make and use derivative works provided
* that such works are identified as "derived from the RSA Data
* Security, Inc. MD4 Message-Digest Algorithm" in all material
* mentioning or referencing the derived work.
*
* RSA Data Security, Inc. makes no representations concerning either
* the merchantability of this software or the suitability of this
* software for any particular purpose. It is provided "as is"
* without express or implied warranty of any kind.
*
* These notices must be retained in any copies of any part of this
* documentation and/or software.
For the crypto\crypt_blowfish.c(.h) component:
* Written by Solar Designer <solar at openwall.com> in 1998-2011.
* No copyright is claimed, and the software is hereby placed in the public
* domain. In case this attempt to disclaim copyright and place the software
* in the public domain is deemed null and void, then the software is
* Copyright (c) 1998-2011 Solar Designer and it is hereby released to the
* general public under the following terms:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* There's ABSOLUTELY NO WARRANTY, express or implied.
See crypto/crypt_blowfish.c for more information.
For the include\apr_md4.h component:
* This is derived from material copyright RSA Data Security, Inc.
* Their notice is reproduced below in its entirety.
*
* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
* rights reserved.
*
* License to copy and use this software is granted provided that it
* is identified as the "RSA Data Security, Inc. MD4 Message-Digest
* Algorithm" in all material mentioning or referencing this software
* or this function.
*
* License is also granted to make and use derivative works provided
* that such works are identified as "derived from the RSA Data
* Security, Inc. MD4 Message-Digest Algorithm" in all material
* mentioning or referencing the derived work.
*
* RSA Data Security, Inc. makes no representations concerning either
* the merchantability of this software or the suitability of this
* software for any particular purpose. It is provided "as is"
* without express or implied warranty of any kind.
*
* These notices must be retained in any copies of any part of this
* documentation and/or software.
For the test\testmd4.c component:
* This is derived from material copyright RSA Data Security, Inc.
* Their notice is reproduced below in its entirety.
*
* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
* rights reserved.
*
* RSA Data Security, Inc. makes no representations concerning either
* the merchantability of this software or the suitability of this
* software for any particular purpose. It is provided "as is"
* without express or implied warranty of any kind.
*
* These notices must be retained in any copies of any part of this
* documentation and/or software.
===============================================================
LIVOXs Livox SDK uses unmodified libraries of Boost (https://www.boost.org), which is licensed under the Boost Software license. A copy of the Boost Software license is provided below and is also available at https://www.boost.org/LICENSE_1_0.txt. LIVOXs Livox SDK uses unmodified libraries of Boost (https://www.boost.org), which is licensed under the Boost Software license. A copy of the Boost Software license is provided below and is also available at https://www.boost.org/LICENSE_1_0.txt.
------------------------------------------------------------- -------------------------------------------------------------

View File

@@ -180,7 +180,7 @@ In the "ws_livox/src/livox_ros_driver/launch" path, there are two json files, li
&ensp;&ensp;&ensp;&ensp;The parameter attributes in the above json file are described in the following table : &ensp;&ensp;&ensp;&ensp;The parameter attributes in the above json file are described in the following table :
<center>LiDAR configuration parameter</center> LiDAR configuration parameter
| Parameter | Type | Description | Default | | Parameter | Type | Description | Default |
| :------------------------- | ------- | ------------------------------------------------------------ | --------------- | | :------------------------- | ------- | ------------------------------------------------------------ | --------------- |
| broadcast_code | String | LiDAR broadcast code, 15 characters, consisting of a 14-character length serial number plus a character-length additional code | 0TFDG3B006H2Z11 | | broadcast_code | String | LiDAR broadcast code, 15 characters, consisting of a 14-character length serial number plus a character-length additional code | 0TFDG3B006H2Z11 |
@@ -215,7 +215,7 @@ In the "ws_livox/src/livox_ros_driver/launch" path, there are two json files, li
&ensp;&ensp;&ensp;&ensp;The main difference between the content of Hub json configuration file and the content of the LiDAR json configuration file is that the Hub configuration item "hub_config" is added, and the related configuration content of the Hub is shown in the following table : &ensp;&ensp;&ensp;&ensp;The main difference between the content of Hub json configuration file and the content of the LiDAR json configuration file is that the Hub configuration item "hub_config" is added, and the related configuration content of the Hub is shown in the following table :
<center>HUB configuration parameter</center> HUB configuration parameter
| Parameter | Type | Description | Default | | Parameter | Type | Description | Default |
| -------------- | ------- | ------------------------------------------------------------ | --------------- | | -------------- | ------- | ------------------------------------------------------------ | --------------- |
| broadcast_code | String | HUB broadcast code, 15 characters, consisting of a 14-character length serial number plus a character-length additional code | 13UUG1R00400170 | | broadcast_code | String | HUB broadcast code, 15 characters, consisting of a 14-character length serial number plus a character-length additional code | 13UUG1R00400170 |
@@ -256,7 +256,7 @@ $GPRMC,190430,A,4812.3038,S,07330.7690,W,3.7,3.8,090210,13.7,E,D*26
livox_ros_driver only supports the timestamp synchronization function when connected to LiDAR. The timestamp related configuration item timesync_config is in the livox_lidar_config.json file. The detailed configuration content is shown in the table below : livox_ros_driver only supports the timestamp synchronization function when connected to LiDAR. The timestamp related configuration item timesync_config is in the livox_lidar_config.json file. The detailed configuration content is shown in the table below :
<center>Timestamp synchronization function configuration instructions</center> Timestamp synchronization function configuration instructions
| Parameter | Type | Description | Default | | Parameter | Type | Description | Default |
| ---------------- | -------- | ------------------------------------------------------------ | -------------- | | ---------------- | -------- | ------------------------------------------------------------ | -------------- |
| enable_timesync | Boolean | Whether to enable the timestamp synchronization <br>true -- Enable timestamp synchronization<br>false -- Disable timestamp synchronization | false | | enable_timesync | Boolean | Whether to enable the timestamp synchronization <br>true -- Enable timestamp synchronization<br>false -- Disable timestamp synchronization | false |
@@ -283,5 +283,5 @@ After replacing "/home/livox/test.lvx" in the above command with the local lvx d
You can get support from Livox with the following methods : You can get support from Livox with the following methods :
* Send email to dev@livoxtech.com with a clear description of your problem and your setup * Send email to cs@livoxtech.com with a clear description of your problem and your setup
* Report issue on github * Report issue on github

View File

@@ -186,7 +186,7 @@ uint8 line # laser number in lidar
&ensp;&ensp;&ensp;&ensp;上面 json 文件中各参数属性说明如下表: &ensp;&ensp;&ensp;&ensp;上面 json 文件中各参数属性说明如下表:
<center>LiDAR 配置参数说明</center> LiDAR 配置参数说明
| 属性 | 类型 | 描述 | 默认值 | | 属性 | 类型 | 描述 | 默认值 |
| :------------------------- | ------ | ------------------------------------------------------------ | --------------- | | :------------------------- | ------ | ------------------------------------------------------------ | --------------- |
| broadcast_code | 字符串 | LiDAR 广播码15位字符由14位字符长度序列号加一个字符长度附加码组成 | 0TFDG3B006H2Z11 | | broadcast_code | 字符串 | LiDAR 广播码15位字符由14位字符长度序列号加一个字符长度附加码组成 | 0TFDG3B006H2Z11 |
@@ -222,7 +222,7 @@ uint8 line # laser number in lidar
&ensp;&ensp;&ensp;&ensp;中心板 json 配置文件内容与 LiDAR 配置文件的主要区别在于,增加了中心板配置项 hub_config ,中心板相关的具体配置内容见下表: &ensp;&ensp;&ensp;&ensp;中心板 json 配置文件内容与 LiDAR 配置文件的主要区别在于,增加了中心板配置项 hub_config ,中心板相关的具体配置内容见下表:
<center>HUB 配置参数说明</center> HUB 配置参数说明
| 属性 | 类型 | 描述 | 默认值 | | 属性 | 类型 | 描述 | 默认值 |
| -------------- | ------ | ------------------------------------------------------------ | --------------- | | -------------- | ------ | ------------------------------------------------------------ | --------------- |
| broadcast_code | 字符串 | HUB 广播码15位字符由14位字符长度的序列号加一个字符长度的附加码组成 | 13UUG1R00400170 | | broadcast_code | 字符串 | HUB 广播码15位字符由14位字符长度的序列号加一个字符长度的附加码组成 | 13UUG1R00400170 |
@@ -265,7 +265,7 @@ uint8 line # laser number in lidar
览沃 ROS 驱动程序只有在与 LiDAR 连接的时候才支持时间戳同步功能,时间戳相关的配置项 timesync_config 位于 livox_lidar_config.json 文件中,详细的配置内容见下表: 览沃 ROS 驱动程序只有在与 LiDAR 连接的时候才支持时间戳同步功能,时间戳相关的配置项 timesync_config 位于 livox_lidar_config.json 文件中,详细的配置内容见下表:
<center>时间戳同步功能配置说明</center> 时间戳同步功能配置说明
| 属性 | 类型 | 描述 | 默认值 | | 属性 | 类型 | 描述 | 默认值 |
| ---------------- | ------ | ------------------------------------------------------------ | -------------- | | ---------------- | ------ | ------------------------------------------------------------ | -------------- |
| enable_timesync | 布尔值 | 是否使能时间戳同步功能<br>true -- 使能时间戳同步功能<br>false -- 禁止时间戳同步功能 | false | | enable_timesync | 布尔值 | 是否使能时间戳同步功能<br>true -- 使能时间戳同步功能<br>false -- 禁止时间戳同步功能 | false |
@@ -292,5 +292,5 @@ uint8 line # laser number in lidar
你可以通过以下方式获取 Livox 的技术支持 : 你可以通过以下方式获取 Livox 的技术支持 :
* 发送邮件到 dev@livoxtech.com ,详细描述您遇到的问题和使用场景 * 发送邮件到 cs@livoxtech.com ,详细描述您遇到的问题和使用场景
* 提交此代码仓的 github issues * 提交此代码仓的 github issues

View File

@@ -212,12 +212,12 @@ install(TARGETS ${PROJECT_NAME}_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
) )
install(DIRECTORY launch/ install(DIRECTORY
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch launch
config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
) )
#--------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------
# end of CMakeList.txt # end of CMakeList.txt
#--------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -20,7 +22,9 @@
<param name="cmdline_str" type="string" value="$(arg bd_list)"/> <param name="cmdline_str" type="string" value="$(arg bd_list)"/>
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_lidar_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="false"/> <arg name="rosbag_enable" default="false"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="false"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -11,6 +11,8 @@
<arg name="rosbag_enable" default="true"/> <arg name="rosbag_enable" default="true"/>
<arg name="cmdline_arg" default="$(arg bd_list)"/> <arg name="cmdline_arg" default="$(arg bd_list)"/>
<arg name="msg_frame_id" default="livox_frame"/> <arg name="msg_frame_id" default="livox_frame"/>
<arg name="lidar_bag" default="true"/>
<arg name="imu_bag" default="true"/>
<param name="xfer_format" value="$(arg xfer_format)"/> <param name="xfer_format" value="$(arg xfer_format)"/>
<param name="multi_topic" value="$(arg multi_topic)"/> <param name="multi_topic" value="$(arg multi_topic)"/>
@@ -21,6 +23,8 @@
<param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/> <param name="cmdline_file_path" type="string" value="$(arg lvx_file_path)"/>
<param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/> <param name="user_config_path" type="string" value="$(find livox_ros_driver)/config/livox_hub_config.json"/>
<param name="frame_id" type="string" value="$(arg msg_frame_id)"/> <param name="frame_id" type="string" value="$(arg msg_frame_id)"/>
<param name="enable_lidar_bag" type="bool" value="$(arg lidar_bag)"/>
<param name="enable_imu_bag" type="bool" value="$(arg imu_bag)"/>
<node name="livox_lidar_publisher" pkg="livox_ros_driver" <node name="livox_lidar_publisher" pkg="livox_ros_driver"
type="livox_ros_driver_node" required="true" type="livox_ros_driver_node" required="true"

View File

@@ -43,13 +43,15 @@ namespace livox_ros {
/** Lidar Data Distribute Control--------------------------------------------*/ /** Lidar Data Distribute Control--------------------------------------------*/
Lddc::Lddc(int format, int multi_topic, int data_src, int output_type, Lddc::Lddc(int format, int multi_topic, int data_src, int output_type,
double frq, std::string &frame_id) double frq, std::string &frame_id, bool lidar_bag, bool imu_bag)
: transfer_format_(format), : transfer_format_(format),
use_multi_topic_(multi_topic), use_multi_topic_(multi_topic),
data_src_(data_src), data_src_(data_src),
output_type_(output_type), output_type_(output_type),
publish_frq_(frq), publish_frq_(frq),
frame_id_(frame_id) { frame_id_(frame_id),
enable_lidar_bag_(lidar_bag),
enable_imu_bag_(imu_bag) {
publish_period_ns_ = kNsPerSecond / publish_frq_; publish_period_ns_ = kNsPerSecond / publish_frq_;
lds_ = nullptr; lds_ = nullptr;
memset(private_pub_, 0, sizeof(private_pub_)); memset(private_pub_, 0, sizeof(private_pub_));
@@ -239,9 +241,9 @@ uint32_t Lddc::PublishPointcloud2(LidarDataQueue *queue, uint32_t packet_num,
if (kOutputToRos == output_type_) { if (kOutputToRos == output_type_) {
p_publisher->publish(cloud); p_publisher->publish(cloud);
} else { } else {
if (bag_) { if (bag_ && enable_lidar_bag_) {
bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0), bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0),
cloud); cloud);
} }
} }
if (!lidar->data_is_pubulished) { if (!lidar->data_is_pubulished) {
@@ -340,9 +342,9 @@ uint32_t Lddc::PublishPointcloudData(LidarDataQueue *queue, uint32_t packet_num,
if (kOutputToRos == output_type_) { if (kOutputToRos == output_type_) {
p_publisher->publish(cloud); p_publisher->publish(cloud);
} else { } else {
if (bag_) { if (bag_ && enable_lidar_bag_) {
bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0), bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0),
cloud); cloud);
} }
} }
if (!lidar->data_is_pubulished) { if (!lidar->data_is_pubulished) {
@@ -464,7 +466,7 @@ uint32_t Lddc::PublishCustomPointcloud(LidarDataQueue *queue,
if (kOutputToRos == output_type_) { if (kOutputToRos == output_type_) {
p_publisher->publish(livox_msg); p_publisher->publish(livox_msg);
} else { } else {
if (bag_) { if (bag_ && enable_lidar_bag_) {
bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0), bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0),
livox_msg); livox_msg);
} }
@@ -513,9 +515,9 @@ uint32_t Lddc::PublishImuData(LidarDataQueue *queue, uint32_t packet_num,
if (kOutputToRos == output_type_) { if (kOutputToRos == output_type_) {
p_publisher->publish(imu_data); p_publisher->publish(imu_data);
} else { } else {
if (bag_) { if (bag_ && enable_imu_bag_) {
bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0), bag_->write(p_publisher->getTopic(), ros::Time(timestamp / 1000000000.0),
imu_data); imu_data);
} }
} }
return published_packet; return published_packet;
@@ -592,9 +594,10 @@ ros::Publisher *Lddc::GetCurrentPublisher(uint8_t handle) {
if (use_multi_topic_) { if (use_multi_topic_) {
pub = &private_pub_[handle]; pub = &private_pub_[handle];
queue_size = queue_size * 2; // queue size is 64 for only one lidar
} else { } else {
pub = &global_pub_; pub = &global_pub_;
queue_size = queue_size * 8; queue_size = queue_size * 8; // shared queue size is 256, for all lidars
} }
if (*pub == nullptr) { if (*pub == nullptr) {
@@ -640,9 +643,10 @@ ros::Publisher *Lddc::GetCurrentImuPublisher(uint8_t handle) {
if (use_multi_topic_) { if (use_multi_topic_) {
pub = &private_imu_pub_[handle]; pub = &private_imu_pub_[handle];
queue_size = queue_size * 2; // queue size is 64 for only one lidar
} else { } else {
pub = &global_imu_pub_; pub = &global_imu_pub_;
queue_size = queue_size * 4; queue_size = queue_size * 8; // shared queue size is 256, for all lidars
} }
if (*pub == nullptr) { if (*pub == nullptr) {

View File

@@ -47,7 +47,7 @@ typedef enum {
class Lddc { class Lddc {
public: public:
Lddc(int format, int multi_topic, int data_src, int output_type, double frq, Lddc(int format, int multi_topic, int data_src, int output_type, double frq,
std::string &frame_id); std::string &frame_id, bool lidar_bag, bool imu_bag);
~Lddc(); ~Lddc();
int RegisterLds(Lds *lds); int RegisterLds(Lds *lds);
@@ -94,6 +94,8 @@ class Lddc {
double publish_frq_; double publish_frq_;
uint32_t publish_period_ns_; uint32_t publish_period_ns_;
std::string frame_id_; std::string frame_id_;
bool enable_lidar_bag_;
bool enable_imu_bag_;
ros::Publisher *private_pub_[kMaxSourceLidar]; ros::Publisher *private_pub_[kMaxSourceLidar];
ros::Publisher *global_pub_; ros::Publisher *global_pub_;
ros::Publisher *private_imu_pub_[kMaxSourceLidar]; ros::Publisher *private_imu_pub_[kMaxSourceLidar];

View File

@@ -43,6 +43,59 @@ bool IsFilePathValid(const char *path_str) {
} }
} }
/** Replace nonstardard function "timegm" with mktime.
* For a portable version of timegm, set the TZ environment variable to UTC,
* call mktime and restore the value of TZ.
* "localtime" and "timegm" are nonstandard GNU extensions that are also present
* on the BSDs. Avoid their use!!!
*/
time_t replace_timegm(struct tm *tm) {
time_t ret;
char *tz;
tz = getenv("TZ");
setenv("TZ", "", 1);
tzset();
ret = mktime(tm);
if (tz)
setenv("TZ", tz, 1);
else
unsetenv("TZ");
tzset();
return ret;
}
uint64_t RawLdsStampToNs(LdsStamp &timestamp, uint8_t timestamp_type) {
if (timestamp_type == kTimestampTypePps) {
return timestamp.stamp;
} else if (timestamp_type == kTimestampTypeNoSync) {
return timestamp.stamp;
} else if (timestamp_type == kTimestampTypePtp) {
return timestamp.stamp;
} else if (timestamp_type == kTimestampTypePpsGps) {
struct tm time_utc;
time_utc.tm_isdst = 0;
time_utc.tm_year = timestamp.stamp_bytes[0] + 100; // map 2000 to 1990
time_utc.tm_mon = timestamp.stamp_bytes[1] - 1; // map 1~12 to 0~11
time_utc.tm_mday = timestamp.stamp_bytes[2];
time_utc.tm_hour = timestamp.stamp_bytes[3];
time_utc.tm_min = 0;
time_utc.tm_sec = 0;
// uint64_t time_epoch = mktime(&time_utc);
uint64_t time_epoch = timegm(&time_utc); // no timezone
time_epoch = time_epoch * 1000000 + timestamp.stamp_word.high; // to us
time_epoch = time_epoch * 1000; // to ns
return time_epoch;
} else {
printf("Timestamp type[%d] invalid.\n", timestamp_type);
return 0;
}
}
uint64_t GetStoragePacketTimestamp(StoragePacket *packet, uint8_t data_src) { uint64_t GetStoragePacketTimestamp(StoragePacket *packet, uint8_t data_src) {
LivoxEthPacket *raw_packet = LivoxEthPacket *raw_packet =
reinterpret_cast<LivoxEthPacket *>(packet->raw_data); reinterpret_cast<LivoxEthPacket *>(packet->raw_data);
@@ -86,6 +139,7 @@ uint32_t CalculatePacketQueueSize(uint32_t interval_ms, uint8_t product_type,
uint32_t queue_size = uint32_t queue_size =
(interval_ms * GetPacketNumPerSec(product_type, data_type)) / 1000; (interval_ms * GetPacketNumPerSec(product_type, data_type)) / 1000;
queue_size = queue_size * 2;
if (queue_size < kMinEthPacketQueueSize) { if (queue_size < kMinEthPacketQueueSize) {
queue_size = kMinEthPacketQueueSize; queue_size = kMinEthPacketQueueSize;
} else if (queue_size > kMaxEthPacketQueueSize) { } else if (queue_size > kMaxEthPacketQueueSize) {
@@ -588,19 +642,21 @@ uint8_t Lds::GetDeviceType(uint8_t handle) {
} }
} }
void Lds::UpdateLidarInfoByEthPacket(LidarDevice *p_lidar, \ void Lds::UpdateLidarInfoByEthPacket(LidarDevice *p_lidar,
LivoxEthPacket* eth_packet) { LivoxEthPacket* eth_packet) {
if (p_lidar->raw_data_type != eth_packet->data_type) { if (p_lidar->raw_data_type != eth_packet->data_type) {
p_lidar->raw_data_type = eth_packet->data_type; p_lidar->raw_data_type = eth_packet->data_type;
p_lidar->packet_interval = GetPacketInterval(p_lidar->info.type, \ p_lidar->packet_interval = GetPacketInterval(p_lidar->info.type,
eth_packet->data_type); eth_packet->data_type);
p_lidar->timestamp_type = eth_packet->timestamp_type;
p_lidar->packet_interval_max = p_lidar->packet_interval * 1.8f; p_lidar->packet_interval_max = p_lidar->packet_interval * 1.8f;
p_lidar->onetime_publish_packets = \ p_lidar->onetime_publish_packets =
GetPacketNumPerSec(p_lidar->info.type, \ GetPacketNumPerSec(p_lidar->info.type,
p_lidar->raw_data_type) * buffer_time_ms_ / 1000; p_lidar->raw_data_type) * buffer_time_ms_ / 1000;
printf("DataType[%d] PacketInterval[%d] PublishPackets[%d]\n", \ printf("Lidar[%d][%s] DataType[%d] timestamp_type[%d] PacketInterval[%d] "
p_lidar->raw_data_type, p_lidar->packet_interval, \ "PublishPackets[%d]\n", p_lidar->handle, p_lidar->info.broadcast_code,
p_lidar->onetime_publish_packets); p_lidar->raw_data_type, p_lidar->timestamp_type,
p_lidar->packet_interval, p_lidar->onetime_publish_packets);
} }
} }
@@ -608,8 +664,15 @@ void Lds::StorageRawPacket(uint8_t handle, LivoxEthPacket* eth_packet) {
LidarDevice *p_lidar = &lidars_[handle]; LidarDevice *p_lidar = &lidars_[handle];
LidarPacketStatistic *packet_statistic = &p_lidar->statistic_info; LidarPacketStatistic *packet_statistic = &p_lidar->statistic_info;
LdsStamp cur_timestamp; LdsStamp cur_timestamp;
uint64_t timestamp;
memcpy(cur_timestamp.stamp_bytes, eth_packet->timestamp, memcpy(cur_timestamp.stamp_bytes, eth_packet->timestamp,
sizeof(cur_timestamp)); sizeof(cur_timestamp));
timestamp = RawLdsStampToNs(cur_timestamp, eth_packet->timestamp_type);
if (timestamp >= kRosTimeMax) {
printf("Raw EthPacket time out of range Lidar[%d]\n", handle);
return;
}
if (kImu != eth_packet->data_type) { if (kImu != eth_packet->data_type) {
UpdateLidarInfoByEthPacket(p_lidar, eth_packet); UpdateLidarInfoByEthPacket(p_lidar, eth_packet);
@@ -629,15 +692,14 @@ void Lds::StorageRawPacket(uint8_t handle, LivoxEthPacket* eth_packet) {
if (nullptr == p_queue->storage_packet) { if (nullptr == p_queue->storage_packet) {
uint32_t queue_size = CalculatePacketQueueSize( uint32_t queue_size = CalculatePacketQueueSize(
buffer_time_ms_, p_lidar->info.type, eth_packet->data_type); buffer_time_ms_, p_lidar->info.type, eth_packet->data_type);
queue_size = queue_size * 8; /* 8 multiple the min size */
InitQueue(p_queue, queue_size); InitQueue(p_queue, queue_size);
printf("Lidar%02d[%s] queue size : %d %d\n", p_lidar->handle, printf("Lidar[%d][%s] storage queue size : %d %d\n", p_lidar->handle,
p_lidar->info.broadcast_code, queue_size, p_queue->size); p_lidar->info.broadcast_code, queue_size, p_queue->size);
} }
if (!QueueIsFull(p_queue)) { if (!QueueIsFull(p_queue)) {
QueuePushAny(p_queue, (uint8_t *)eth_packet, \ QueuePushAny(p_queue, (uint8_t *)eth_packet,
GetEthPacketLen(eth_packet->data_type), \ GetEthPacketLen(eth_packet->data_type),
packet_statistic->timebase, \ packet_statistic->timebase,
GetPointsPerPacket(eth_packet->data_type)); GetPointsPerPacket(eth_packet->data_type));
if (QueueUsedSize(p_queue) > p_lidar->onetime_publish_packets) { if (QueueUsedSize(p_queue) > p_lidar->onetime_publish_packets) {
if (semaphore_.GetCount() <= 0) { if (semaphore_.GetCount() <= 0) {
@@ -662,13 +724,13 @@ void Lds::StorageRawPacket(uint8_t handle, LivoxEthPacket* eth_packet) {
if (nullptr == p_queue->storage_packet) { if (nullptr == p_queue->storage_packet) {
uint32_t queue_size = 256; /* fixed imu data queue size */ uint32_t queue_size = 256; /* fixed imu data queue size */
InitQueue(p_queue, queue_size); InitQueue(p_queue, queue_size);
printf("Lidar%02d[%s] imu queue size : %d %d\n", p_lidar->handle, printf("Lidar[%d][%s] imu storage queue size : %d %d\n", p_lidar->handle,
p_lidar->info.broadcast_code, queue_size, p_queue->size); p_lidar->info.broadcast_code, queue_size, p_queue->size);
} }
if (!QueueIsFull(p_queue)) { if (!QueueIsFull(p_queue)) {
QueuePushAny(p_queue, (uint8_t *)eth_packet, \ QueuePushAny(p_queue, (uint8_t *)eth_packet,
GetEthPacketLen(eth_packet->data_type),\ GetEthPacketLen(eth_packet->data_type),
packet_statistic->imu_timebase, \ packet_statistic->imu_timebase,
GetPointsPerPacket(eth_packet->data_type)); GetPointsPerPacket(eth_packet->data_type));
} }
} }

View File

@@ -48,7 +48,7 @@ const uint32_t kMaxSourceLidar = 32;
/** Eth packet relative info parama */ /** Eth packet relative info parama */
const uint32_t kMaxPointPerEthPacket = 100; const uint32_t kMaxPointPerEthPacket = 100;
const uint32_t kMinEthPacketQueueSize = 32; /**< must be 2^n */ const uint32_t kMinEthPacketQueueSize = 32; /**< must be 2^n */
const uint32_t kMaxEthPacketQueueSize = 8192; /**< must be 2^n */ const uint32_t kMaxEthPacketQueueSize = 131072; /**< must be 2^n */
const uint32_t kImuEthPacketQueueSize = 256; const uint32_t kImuEthPacketQueueSize = 256;
const uint32_t KEthPacketHeaderLength = 18; /**< (sizeof(LivoxEthPacket) - 1) */ const uint32_t KEthPacketHeaderLength = 18; /**< (sizeof(LivoxEthPacket) - 1) */
@@ -56,6 +56,7 @@ const uint32_t KEthPacketHeaderLength = 18; /**< (sizeof(LivoxEthPacket) - 1) */
const uint32_t KCartesianPointSize = 13; const uint32_t KCartesianPointSize = 13;
const uint32_t KSphericalPointSzie = 9; const uint32_t KSphericalPointSzie = 9;
const uint64_t kRosTimeMax = 4294967296000000000; /**< 2^32 * 1000000000ns */
const int64_t kPacketTimeGap = 1000000; /**< 1ms = 1000000ns */ const int64_t kPacketTimeGap = 1000000; /**< 1ms = 1000000ns */
/**< the threshold of packet continuous */ /**< the threshold of packet continuous */
const int64_t kMaxPacketTimeGap = 1700000; const int64_t kMaxPacketTimeGap = 1700000;
@@ -171,9 +172,10 @@ typedef struct {
typedef struct { typedef struct {
uint8_t handle; /**< Lidar access handle. */ uint8_t handle; /**< Lidar access handle. */
uint8_t data_src; /**< From raw lidar or livox file. */ uint8_t data_src; /**< From raw lidar or livox file. */
uint8_t raw_data_type; /**< The data type in eth packaet */ uint8_t raw_data_type; /**< The data type in eth packaet. */
bool data_is_pubulished; /**< Indicate the data of lidar whether is bool data_is_pubulished; /**< Indicate the data of lidar whether is
pubulished. */ pubulished. */
uint32_t timestamp_type; /**< timestamp type of the current eth packet. */
volatile uint32_t packet_interval; /**< The time interval between packets volatile uint32_t packet_interval; /**< The time interval between packets
of current lidar, unit:ns */ of current lidar, unit:ns */
volatile uint32_t packet_interval_max; /**< If more than it, volatile uint32_t packet_interval_max; /**< If more than it,
@@ -262,6 +264,8 @@ const ProductTypePointInfoPair product_type_info_pair_table[kMaxProductType] = {
* Global function for general use. * Global function for general use.
*/ */
bool IsFilePathValid(const char *path_str); bool IsFilePathValid(const char *path_str);
time_t replace_timegm(struct tm *tm);
uint64_t RawLdsStampToNs(LdsStamp &timestamp, uint8_t timestamp_type);
uint64_t GetStoragePacketTimestamp(StoragePacket *packet, uint8_t data_src); uint64_t GetStoragePacketTimestamp(StoragePacket *packet, uint8_t data_src);
uint32_t CalculatePacketQueueSize(uint32_t interval_ms, uint8_t product_type, uint32_t CalculatePacketQueueSize(uint32_t interval_ms, uint8_t product_type,
uint8_t data_type); uint8_t data_type);

View File

@@ -120,11 +120,6 @@ int LdsLvx::InitLdsLvx(const char *lvx_path) {
p_extrinsic->trans[2] = lvx_dev_info.z; p_extrinsic->trans[2] = lvx_dev_info.z;
EulerAnglesToRotationMatrix(p_extrinsic->euler, p_extrinsic->rotation); EulerAnglesToRotationMatrix(p_extrinsic->euler, p_extrinsic->rotation);
p_extrinsic->enable = lvx_dev_info.extrinsic_enable; p_extrinsic->enable = lvx_dev_info.extrinsic_enable;
uint32_t queue_size = kMaxEthPacketQueueSize * 16;
InitQueue(&lidars_[handle].data, queue_size);
queue_size = kMaxEthPacketQueueSize;
InitQueue(&lidars_[handle].imu_data, queue_size);
} }
t_read_lvx_ = t_read_lvx_ =
@@ -166,6 +161,19 @@ void LdsLvx::ReadLvxFile() {
} }
data_type = eth_packet->data_type; data_type = eth_packet->data_type;
if (handle >= lvx_file_->GetDeviceCount()) {
printf("Raw data handle error, error handle is %d\n", handle);
break;
}
if (data_type >= kMaxPointDataType) {
printf("Raw data type error, error data_type is %d\n", data_type);
break;
}
if (eth_packet->version != 5) {
printf("EthPacket version[%d] not supported\n", eth_packet->version);
break;
}
/** Packet length + device index */ /** Packet length + device index */
data_offset += (GetEthPacketLen(data_type) + 1); data_offset += (GetEthPacketLen(data_type) + 1);
StorageRawPacket(handle, eth_packet); StorageRawPacket(handle, eth_packet);

View File

@@ -26,6 +26,7 @@
#include <chrono> #include <chrono>
#include <vector> #include <vector>
#include <csignal>
#include <ros/ros.h> #include <ros/ros.h>
#include "lddc.h" #include "lddc.h"
@@ -38,9 +39,13 @@ using namespace livox_ros;
const int32_t kSdkVersionMajorLimit = 2; const int32_t kSdkVersionMajorLimit = 2;
int main(int argc, char **argv) { inline void SignalHandler(int signum) {
ROS_INFO("Livox Ros Driver Version: %s", LIVOX_ROS_DRIVER_VERSION_STRING); printf("livox ros driver will exit\r\n");
ros::shutdown();
exit(signum);
}
int main(int argc, char **argv) {
/** Ros related */ /** Ros related */
if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME,
ros::console::levels::Debug)) { ros::console::levels::Debug)) {
@@ -49,6 +54,8 @@ int main(int argc, char **argv) {
ros::init(argc, argv, "livox_lidar_publisher"); ros::init(argc, argv, "livox_lidar_publisher");
ros::NodeHandle livox_node; ros::NodeHandle livox_node;
ROS_INFO("Livox Ros Driver Version: %s", LIVOX_ROS_DRIVER_VERSION_STRING);
signal(SIGINT, SignalHandler);
/** Check sdk version */ /** Check sdk version */
LivoxSdkVersion _sdkversion; LivoxSdkVersion _sdkversion;
GetLivoxSdkVersion(&_sdkversion); GetLivoxSdkVersion(&_sdkversion);
@@ -62,9 +69,11 @@ int main(int argc, char **argv) {
int xfer_format = kPointCloud2Msg; int xfer_format = kPointCloud2Msg;
int multi_topic = 0; int multi_topic = 0;
int data_src = kSourceRawLidar; int data_src = kSourceRawLidar;
double publish_freq = 10.0; /* Hz */ double publish_freq = 10.0; /* Hz */
int output_type = kOutputToRos; int output_type = kOutputToRos;
std::string frame_id = "livox_frame"; std::string frame_id = "livox_frame";
bool lidar_bag = true;
bool imu_bag = false;
livox_node.getParam("xfer_format", xfer_format); livox_node.getParam("xfer_format", xfer_format);
livox_node.getParam("multi_topic", multi_topic); livox_node.getParam("multi_topic", multi_topic);
@@ -72,17 +81,19 @@ int main(int argc, char **argv) {
livox_node.getParam("publish_freq", publish_freq); livox_node.getParam("publish_freq", publish_freq);
livox_node.getParam("output_data_type", output_type); livox_node.getParam("output_data_type", output_type);
livox_node.getParam("frame_id", frame_id); livox_node.getParam("frame_id", frame_id);
livox_node.getParam("enable_lidar_bag", lidar_bag);
livox_node.getParam("enable_imu_bag", imu_bag);
if (publish_freq > 100.0) { if (publish_freq > 100.0) {
publish_freq = 100.0; publish_freq = 100.0;
} else if (publish_freq < 1.0) { } else if (publish_freq < 0.1) {
publish_freq = 1.0; publish_freq = 0.1;
} else { } else {
publish_freq = publish_freq; publish_freq = publish_freq;
} }
/** Lidar data distribute control and lidar data source set */ /** Lidar data distribute control and lidar data source set */
Lddc *lddc = new Lddc(xfer_format, multi_topic, data_src, output_type, Lddc *lddc = new Lddc(xfer_format, multi_topic, data_src, output_type,
publish_freq, frame_id); publish_freq, frame_id, lidar_bag, imu_bag);
lddc->SetRosNode(&livox_node); lddc->SetRosNode(&livox_node);
int ret = 0; int ret = 0;

View File

@@ -27,6 +27,7 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <chrono> #include <chrono>
#include <cstdio>
#include <functional> #include <functional>
#include <thread> #include <thread>
@@ -98,7 +99,7 @@ void TimeSync::StopTimesync() {
t_poll_state_ = nullptr; t_poll_state_ = nullptr;
} }
if (t_poll_state_) { if (t_poll_data_) {
t_poll_data_->join(); t_poll_data_->join();
t_poll_data_ = nullptr; t_poll_data_ = nullptr;
} }
@@ -139,8 +140,12 @@ void TimeSync::PollDataLoop() {
CommPacket packet; CommPacket packet;
memset(&packet, 0, sizeof(packet)); memset(&packet, 0, sizeof(packet));
while ((kParseSuccess == comm_->ParseCommStream(&packet))) { while ((kParseSuccess == comm_->ParseCommStream(&packet))) {
if ((fn_cb_ != nullptr) || (client_data_ != nullptr)) { if (((fn_cb_ != nullptr) || (client_data_ != nullptr))) {
fn_cb_((const char *)packet.data, packet.data_len, client_data_); if ((strstr((const char *)packet.data, "$GPRMC")) ||
(strstr((const char *)packet.data , "$GNRMC"))){
fn_cb_((const char *)packet.data, packet.data_len, client_data_);
printf("RMC data parse success!.\n");
}
} }
} }
} }