GithubHelp home page GithubHelp logo

bluesea-ros2's Introduction

BLUESEA ROS2 driver

Overview


BLUESEA ROS2 driver is specially designed to connect to the lidar products produced by our company. The driver can run on operating systems with ROS2 installed, and mainly supports ubuntu series operating systems (14.04LTS-20.04LTS). The hardware platforms that have been tested to run the ROS2 driver include: Intel x86 mainstream CPU platform, and some ARM64 hardware platforms (such as NVIDIA, Rockchip, Raspberry Pi, etc., which may need to update the cp210x driver).

Get and build the BLUESEA ROS driver package

1.Get the BLUESEA ROS driver from Github and deploy the corresponding location

mkdir bluesea2   											//create a folder and customize it
cd bluesea2    												//into this folder
git clone https://github.com/BlueSeaLidar/bluesea-ros2.git  src //download the driver package and rename it to src

2.Build

catkin_make

3.Update the current ROS2 package environment

source ./install/setup.sh

4.Using ROS2 launch to run drivers

sudo chmod 777 /dev/ttyUSB0 (uart)			//  /dev/ttyUSB0  refers to the serial port name. If it is a serial/virtual serial port model, it needs to be authorized

ros2 launch bluesea2 [launch file]    		//The specific launch file description is as follows

Driver launch launch file

explain:[launch file] refers to the configuration files in the src/launch folder, distinguished by functional categories

  • uart_lidar.launch(clockwise/anticlockwise): lidar with serial port connection method
  • udp_lidar.launch(clockwise/anticlockwise): lidar for UDP network communication
  • vpc_lidar.launch(clockwise/anticlockwise): lidar with virtual serial port connection method
  • dual_udp_lidar.launch(clockwise/anticlockwise): lidar with multiple UDP network communication(only one node)
  • template: All parameter definition templates

Main parameter configuration instructions:

#ROS# (mandatory parameter for the framework)
<param name="topic" value="scan" />#Publish topic
<param name="frame_id" value="map" />#Name of the flag coordinate system
 #DATA# (driver-defined data level limiting parameter)
<param name="min_dist" value="0.01" />#Minimum point cloud distance (m)
<param name="max_dist" value="50.0"/>#Maximum point cloud distance (m)
<param name="from_zero" value="false"/>#Whether start angle is from 0 (false is 180).
<param name="output_scan" value="true" />#2D scan data (default)
<param name="output_cloud" value="false"/>#3D spatial data.
<param name="output_360" value="true" />#Output by frame.
<param name="inverted" value="false"/>#Publish data angle parameter inverted(angle_min,angle_max,angle_increment).
<param name="reversed" value="false"/>#Publish data point cloud data reversed (row from last point to first point)
<param name="hard_resample" value="false"/>#hard_resample_factor(if lidar support this command)
<param name="soft_resample" value="false"/>#Soft resample coefficient (need point cloud larger than the minimum number of points for soft resample)
<param name="with_angle_filter" value="false"/>#Angle filter switch.
<param name="min_angle" value="-3.1415926"/>#Minimum available angle.
<param name="max_angle" value="3.1415926"/#Maximum available angle.
<rosparam param="mask1" >[-3.14,3.14]</rosparam>#mask data for angle in this interval
<param name="time_mode" value="0"/>#Timestamp source of packet (default 0 system time, 1 is lidar time synchronized time)
<! -- <rosparam param="mask2" >[-1,0]</rosparam-->#Multiple segments to mask the angle of the interval, mask upwards +1
#CUSTOM# (driver customization function)
<param name="error_circle" value="3"/># Judge the weight of the point with distance 0 Three consecutive circles.
<param name="error_scale" value="0.9"/># 90% of points with distance 0 in each circle will report error.
<param name="group_listener" value="false" />#Only used to listen to multicast data (need to change the upload address of lidar by host computer, and fix the upload, then this driver will listen to the data).
<param name="group_ip" value="224.0.0.11" />#Listen to multicast ip.
#FITTER# (lidar different angular resolution parameters are different, need to be customized)
<param name="filter_open" value="true"/>#Filter enable switch.
<param name="max_range" value="20"/#Maximum range for filtering.
<param name="min_range" value="0.5"/>#Minimum range for filtering.
<param name="max_range_difference" value="0.1"/>#Physical range to judge the divergence.
<param name="filter_window" value="1"/>#Range of subscripts for judging outliers
#CONNECT# (parameter that drives the connection lidar)
<param name="type" value="udp" />
<param name="lidar_port" value="6543" />
<param name="local_port" value="6668" />
<param name="lidar_ip" value="192.168.158.98" />
#GET# (the query command switch that the driver sends to the lidar)
<param name="uuid" value="-1" /> #Query lidar SN number, -1 no query, >=0 query
#SET# (set command switch that driver sends to lidar)
<param name="rpm" value="-1"/#Set lidar rpm (different models of lidar can support different rpm, specific check the manual of the model):-1 not set 600 900 ... Setting
<param name="sample_res" value="-1"/>#set angular resolution (different lidar models can support different angular resolution, check the manual of the model),-1 not set 0 original data 1 angular correction
<param name="with_smooth" value="-1" />#Set de-smooth point, -1 not set 0 off 1 on.
<param name="with_deshadow" value="-1" />#Set filtering, -1 not set 0 off 1 on
<param name="alarm_msg" value="-1" />#set alarm message, -1 not set 0 off 1 on
<param name="direction" value="-1"/>#Set direction of rotation(only used by lidar which support this command),-1 not set 0 off 1 on

Driver Client Functional Description

source code locate at src/client.cpp start/stop rotate:

#rosrun bluesea2  bluesea2_client start  0  arg1 is (start/stop)  arg2 is lidar serial (Starting from 0, if it is a negative number, it means that all lidars are executed.)
ros2 run bluesea2  bluesea_node_client start 
ros2 run bluesea2 bluesea_node_client stop 

switch defense zones:

#rosrun bluesea2  bluesea2_client switchZone  0    192.168.158.98     arg1 is switchZone   arg2 is defense zones to be switched  arg3 is lidar ip

set rpm:

rosrun bluesea2  bluesea2_client rpm  0 600   arg1 is rpm   arg2 is lidar serial(start from zero)  arg3 is rpm to be set

rosbag bag operating instructions

rostopic list 

Get the topic list, the driver default topic name is /lidar1/scan

rosbag record /lidar1/scan 

Start recording data.

The recorded file is named with a timestamp, to stop recording, CTRL+C in the current terminal

rosbag play packet name

Check the recorded packet in the path where the packet is stored, if it prompts failed connect master exception, then ros master first and then rosbag play.

Business Support

Please contact the technical support (https://pacecat.com/) through the official website for specific usage problems.

bluesea-ros2's People

Contributors

bluesealidar avatar johnrayn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bluesea-ros2's Issues

报错了,so many mistakes, please help me.

colcon build 之后一大批错误:
图片
/home/ben/ros2_ws/src/bluesea-ros2/src/bluesea_node.cpp:989:73: error: invalid conversion from ‘int’ to ‘int*’ [-fpermissive]
989 | g_reader = StartUartReader(g_type.c_str(),port.c_str(), baud_rate, rates, parsers[0], hubs[0],Savelog,logPath.c_str());
| ^~~~~~~~~
| |
| int

/home/ben/ros2_ws/src/bluesea-ros2/src/bluesea_node.cpp:989:43: error: too many arguments to function ‘void* StartUartReader(const char*, int, int*, HParser, HPublish)’
989 | g_reader = StartUartReader(g_type.c_str(),port.c_str(), baud_rate, rates, parsers[0], hubs[0],Savelog,logPath.c_str());
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ben/ros2_ws/src/bluesea-ros2/src/bluesea_node.cpp:17:
/home/ben/ros2_ws/src/bluesea-ros2/include/reader.h:20:9: note: declared here
20 | HReader StartUartReader(const char* port, int baudrate, int* rate_list, HParser, HPublish);
| ^~~~~~~~~~~~~~~
/home/ben/ros2_ws/src/bluesea-ros2/src/bluesea_node.cpp:1001:42: error: no matching function for call to ‘StartUDPReader(const char*, int&, bool&, const char*, int&, LidarInfo [8], bool&, const char*)’
1001 | g_reader = StartUDPReader(g_type.c_str(),local_port, is_group_listener, group_ip.c_str(), lidar_count, lidars,Savelog,logPath.c_str());
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ben/ros2_ws/src/bluesea-ros2/src/bluesea_node.cpp:17:
/home/ben/ros2_ws/src/bluesea-ros2/include/reader.h:24:9: note: candidate: ‘void* StartUDPReader(const char*, short unsigned int, short unsigned int, bool, const char*, HParser, HPublish)’
24 | HReader StartUDPReader(const char* lidar_ip, unsigned short lidar_port, unsigned short listen_port,
| ^~~~~~~~~~~~~~
/home/ben/ros2_ws/src/bluesea-ros2/include/reader.h:24:9: note: candidate expects 7 arguments, 8 provided
/home/ben/ros2_ws/src/bluesea-ros2/include/reader.h:28:9: note: candidate: ‘void* StartUDPReader(short unsigned int, bool, const char*, int, const LidarInfo*)’
28 | HReader StartUDPReader( unsigned short listen_port, bool is_group_listener, const char* group_ip,
| ^~~~~~~~~~~~~~
/home/ben/ros2_ws/src/bluesea-ros2/include/reader.h:28:9: note: candidate expects 5 arguments, 8 provided
gmake[2]: *** [CMakeFiles/bluesea_node.dir/build.make:76: CMakeFiles/bluesea_node.dir/src/bluesea_node.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/bluesea_node.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2

Failed <<< bluesea2 [12.8s, exited with code 2]

launch LSS-40S-B20E44.launch died

I have finished the colcon build of bluesea2, but when I try to launch it, the error happened.
All the operation was SSH to my raspberry Pi CM4, and LSS-40S-B20E44 Lidar was connect to ttyACM0 use raspberry pi's GPIO as UART.

pi@raspberrypi:~/ros2_serial_ws $ ros2 launch bluesea2 LSS-40S-B20E44.launch
[INFO] [launch]: All log files can be found below /home/pi/.ros/log/2022-11-10-07-58-34-681500-raspberrypi-2741
[INFO] [launch]: Default logging verbosity is set to INFO
Current ROS2 Version: foxy
[INFO] [bluesea_node-1]: process started with pid [2754]
[bluesea_node-1] we will connect to 1 lidars
[bluesea_node-1] lidar[0] address 192.168.0.98:6543, topic `scan
[bluesea_node-1] [0] => 53
[bluesea_node-1] [1] => 48
[bluesea_node-1] [2] => 48
[bluesea_node-1] [3] => 48
[bluesea_node-1] [4] => 48
[bluesea_node-1] [5] => 48
[bluesea_node-1] [6] => 44
[bluesea_node-1] [7] => 32
[bluesea_node-1] [8] => 55
[bluesea_node-1] [9] => 54
[bluesea_node-1] [10] => 56
[bluesea_node-1] [11] => 48
[bluesea_node-1] [12] => 48
[bluesea_node-1] [13] => 48
[bluesea_node-1] [14] => 44
[bluesea_node-1] [15] => 32
[bluesea_node-1] [16] => 57
[bluesea_node-1] [17] => 50
[bluesea_node-1] [18] => 49
[bluesea_node-1] [19] => 54
[bluesea_node-1] [20] => 48
[bluesea_node-1] [21] => 48
[bluesea_node-1] reported 500000
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5524 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5866 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5812 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5812 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5684 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5994 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5684 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5940 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 6122 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5812 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5812 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5684 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5940 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5939 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 6197 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5684 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5940 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5940 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5940 bytes, not found PRODUCT SN:
[bluesea_node-1] send command : 'LUUIDH'
[bluesea_node-1] read 5940 bytes, not found VENDOR ID:
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 6122 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5812 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5812 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5684 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 6122 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5812 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5812 bytes, not found LiDAR
[bluesea_node-1] send command : 'LFFF1H'
[bluesea_node-1] read 5866 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5812 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5812 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5684 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSSS1H'
[bluesea_node-1] read 5940 bytes, not found LiDAR
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5940 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5940 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 6122 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5812 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5812 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5738 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5866 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5812 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5812 bytes, not found RPM
[bluesea_node-1] send command : 'LSRPM:600H'
[bluesea_node-1] read 5684 bytes, not found RPM
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5940 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5940 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5940 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 6122 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5812 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5812 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5684 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5940 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 6122 bytes, not found set resolution
[bluesea_node-1] send command : 'LSRES:001H'
[bluesea_node-1] read 5812 bytes, not found set resolution
[bluesea_node-1] send command : 'LSPST:1H'
[ERROR] [bluesea_node-1]: process has died [pid 2754, exit code -11, cmd '/home/pi/ros2_serial_ws/install/bluesea2/lib/bluesea2/bluesea_node --ros-args -r __node:=bluesea_node -r __ns:=/ --params-file /home/pi/ros2_serial_ws/install/bluesea2/share/bluesea2/params/LSS-40S-B20E44.yaml'].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.