Introduce NVISTAR's two-dimensional DTOF lidar ROC 300 to test the ROS1 driver and ROS2 driver in the EHub_tx1_tx2_E100 carrier board and TX1 core module environment (Ubuntu18.04), open and use RVIZ to view point cloud data, the prerequisite for this article is your TX1 ROS1 version: Melodic, ROS2 version: eloquent has been installed.
Hello everyone, I'm Brother Hu, and I have applied for the NVISTAR ROC 300 radar sample from the manufacturer. This time I also tried to test LiDAR in the ROS2 eloquent environment for the first time. Since I am not very familiar with it, I am learning while testing. Here is also a summary of my simple testing experience and share it with everyone.
For the test hardware EHub_tx1_tx2_E100 carrier board, please check: EdgeBox_EHub_tx1_tx2_E100 Development Board Evaluation_Robot Huge's Blog-CSDN Blog
Table of contents
1.1 Main parameters and indicators
2. Information and description of main components
3. Use of NVISTAR point cloud client (windows version) (micro-USB)
3.2 Radar connected to WIN computer
3.4 Network adapter board parameter configuration
4. ROS1 environment display point cloud (network port)
4.3 Compile the source package
4.4 Connect the radar to the E100 system through the network port
4.5 Modify the test code environment to the network port mode
4.7 Start RVIZ to view the point cloud
5. ROS2-eloquent driver test (network port)
5.1 Create a workspace directory
5.4 Use colcon to compile the project
5.5 Modify the code and use the network port mode
5.6 Run the test node and view the point cloud
1. Parameter indicators:
ROC 300 is a single-line lidar product launched by more than technology. The radar uses the pulsed time-of-flight method (Pulsed ToF) for distance measurement, and its internal structure adopts a rotating mirror design, that is, the invisible infrared laser emitted by the ranging module is deflected to different angles through the high-speed rotating mirror surface, so as to realize the distance measurement. Scanning measurement of the environmental profile within 300° of the same horizontal plane. ROC 300 can output 20K point cloud data per second, and can meet the customer’s maximum distance measurement requirement of 50 meters; it adopts 905nm infrared laser, cooperates with self-developed signal processing algorithm, and the dustproof and waterproof of the whole machine reaches IP65, meeting the needs of outdoor application scenarios.
Compared with similar products, ROC 300 has the following features:
-
Long distance, high precision . Due to the principle of pulse ranging and optimized photoelectric design, ROC 300 has a longer measurement distance for targets with the same reflectivity, and the full-scale accuracy can be guaranteed within +/-3cm, which is very suitable for large space scenes.
-
High speed, low noise. The mirror-type rotary scanning is adopted, and the rotating part is only a very light mirror, so it can reach a high speed of 30HZ, which can be extended up to 50HZ, and maintains extremely low noise, which is almost inaudible to the human ear.
-
High reliability and strong versatility . The rotating mirror design minimizes the moving parts inside the radar, which improves the service life and greatly reduces the impact of mechanical vibration on operation; in addition, the ROC 300 adopts a micro USB interface design, which can flexibly switch between UART and Ethernet ports.
-
Small size and light weight . The height of the radar body does not exceed 7.5 cm and the side length of the base is only 5 cm, which is convenient for installation in places where space is limited.
1.1 Main parameters and indicators
-
Laser wavelength: 905nm, class I
-
Detection range: 0.1m~50m
-
Repeatability: 3cm
-
Horizontal viewing angle: 300°
-
Scanning frequency: 10HZ~30HZ
-
Horizontal angular resolution: 0.18° (10HZ) ~ 0.54° (30HZ)
-
Anti-glare: >80000LX
-
Power supply: 5V/500mA
-
Power consumption: <2.5w
-
Dimensions: 50mm * 50mm * 75mm
-
Weight: 150g
-
Protection class: IP65
-
Interface: micro-USB, Ethernet port, RS232, NPN
-
Working environment temperature: -10℃~55℃
-
Storage environment temperature: -30℃~75℃
2. Information and description of main components
Official Website Download Center: Download Center-Shenzhen More than Technology Co., Ltd.-Shenzhen More than Technology Co., Ltd.
2.1 Out of the box
This time I mainly tested its network port module, so I asked the manufacturer to configure a USB-to-network port adapter module. The radar itself is a micro-USB interface.
2.2 Network adapter board
3. Use of NVISTAR point cloud client (windows version) (micro-USB)
3.1 Obtain tool software
After downloading and decompressing, get the file and instructions:
The software is an installation-free version, just open it directly:
Remarks: We are testing the network port mode
3.2 Radar connected to WIN computer
Set your computer's IP to 1 network segment
Can ping the network adapter board
3.3 Tool software link radar
If the configuration is correct, you can see the point cloud data.
3.4 Network adapter board parameter configuration
In fact, the network port of this radar uses an adapter board to convert the serial port to the network port, so operations such as modifying the IP are actually modifying the IP of the network port conversion module, so a special tool is required:
First read the parameters:
Modify IP:
After modifying the IP, you need to restart the adapter board
It can be pinged, and the new IP has taken effect.
4. ROS1 environment display point cloud (network port)
The package can be obtained from the download page of the official website.
4.1 Create a workspace
mkdir -p ~/SensorWS/Nvistar_ws/src
cd ~/SensorWS/Nvistar_ws/
catkin_make
source devel/setup.bash
4.2 Copy code
cd ~/SensorWS/Nvistar_ws/src
#将官网地址的代码包放置到这个目录解压
4.3 Compile the source package
cd ~/SensorWS/Nvistar_ws
catkin_make --pkg nvilidar_ros
Compilation is complete.
4.4 Connect the radar to the E100 system through the network port
First make sure that the corresponding IP of the board link network port is also 1 network segment. The radar has confirmed that it is 1 network segment before.
The second is that the IP of the radar can be pinged on the board: 192.168.1.100
There is no problem with the network link between the radar and the board.
4.5 Modify the test code environment to the network port mode
1. Modify the launch file
/home/nvidia/Nvistar_ws/src/nvilidar_ros/launch/lidar.launch Screenplay
/home/nvidia/SensorWS/Nvistar_ws/src/nvilidar_ros/launch
vim lidar.launch
<launch>
<node name="nvilidar_node" pkg="nvilidar_ros" type="nvilidar_node" output="screen" respawn="false" >
<param name="serialport_name" type="string" value="/dev/nvilidar"/>
<param name="serialport_baud" type="int" value="512000"/>
<param name="ip_addr" type="string" value="192.168.1.200"/>
<param name="lidar_udp_port" type="int" value="8100"/>
<param name="config_udp_port" type="int" value="8200"/>
<param name="frame_id" type="string" value="laser_frame"/>
<param name="resolution_fixed" type="bool" value="true"/>
<param name="auto_reconnect" type="bool" value="true"/>
<param name="reversion" type="bool" value="false"/>
<param name="inverted" type="bool" value="false"/>
<param name="angle_min" type="double" value="-180" />
<param name="angle_max" type="double" value="180" />
<param name="range_min" type="double" value="0.001" />
<param name="range_max" type="double" value="64.0" />
<param name="aim_speed" type="double" value="10.0"/>
<param name="sampling_rate" type="int" value="10"/>
<param name="sensitive" type="bool" value="false"/>
<param name="tailing_level" type="int" value="6"/>
<param name="angle_offset_change_flag" type="bool" value="false"/>
<param name="angle_offset" type="double" value="0.0" />
<param name="apd_change_flag" type="bool" value="false"/>
<param name="apd_value" type="int" value="500"/>
<param name="ignore_array_string" type="string" value="" />
<param name="filter_jump_enable" type="bool" value="true" />
<param name="filter_jump_value_min" type="int" value="3" />
<param name="filter_jump_value_max" type="int" value="50" />
</node>
<node pkg="tf" type="static_transform_publisher" name="base_link_to_laser"
args="0.19 0.0 0.2 0.06 0.0 0.0 /base_footprint /laser_frame 40" />
</launch>
According to your actual hardware environment and needs, you can modify the network port, scanning angle and other parameters.
2. Modify the nvilidar_node.cpp file
original:
After modification:
4.6 Recompile and start
We changed the original code file configuration above, so we need to recompile the project
cd ~/SensorWS/Nvistar_ws
catkin_make --pkg nvilidar_ros
start up:
cd ~/SensorWS/Nvistar_ws
source devel/setup.bash
roslaunch nvilidar_ros lidar.launch
Open a new terminal to query node information
rosnode list -------------------------------------------------------------------------------- /base_link_to_laser /nvilidar_node /rosout rosnode info /nvilidar_node -------------------------------------------------------------------------------- Node [/nvilidar_node] Publications: * /rosout [rosgraph_msgs/Log] * /scan [sensor_msgs/LaserScan] Subscriptions: None Services: * /nvilidar_node/get_loggers * /nvilidar_node/set_logger_level contacting node http://nvidia-desktop:43281/ ... Pid: 10996 Connections: * topic: /rosout * to: /rosout * direction: outbound (38203 - 127.0.0.1:44442) [11] * transport: TCPROS
4.7 Start RVIZ to view the point cloud
Open the terminal and start the radar node
cd ~/SensorWS/Nvistar_ws
source devel/setup.bash
roslaunch nvilidar_ros lidar.launch
Open a new terminal, start rviz, and log in on the nomachine terminal desktop
rosrun rviz rviz
There is no information at this time, the official has provided us with the configuration file of rviz, we can open and use it directly without configuration.
5. ROS2-eloquent driver test (network port)
The package can be obtained from the download page of the official website.
5.1 Create a workspace directory
source /opt/ros/eloquent/setup.bash
mkdir -p ~/SensorWS/Nvistar_Ros2ws/src
cd ~/SensorWS/Nvistar_Ros2ws/
5.2 Copy code
cd ~/SensorWS/Nvistar_Ros2ws/src
#将官网地址的代码包放置到这个目录解压
5.3 Resolve dependencies
Before building your workspace, you need to resolve package dependencies. You may already have all dependencies, and if you don't want your build to fail due to missing dependencies after a long wait, it's best practice to check dependencies every time.
cd ~/SensorWS/Nvistar_Ros2ws/
rosdep install -i --from-path src --rosdistro eloquent -y
If the following error occurs, continue to use the Xiaoyu one-click installation that was prompted during the previous installation.
fix bug
wget http://fishros.com/install -O fishros && . fishros
After completion, continue the previous command to build dependencies, and you will be successful. Remarks: I have installed ROS1 and ROS2 at the same time, so I will choose one more step later.
Continue to build dependencies
cd ~/SensorWS/Nvistar_Ros2ws/
rosdep install -i --from-path src --rosdistro eloquent -y
5.4 Use colcon to compile the project
cd ~/SensorWS/Nvistar_Ros2ws/
#编译
colcon build
Regardless of the alarm, it can be compiled and passed.
#colcon build can also take some parameters, let’s share this: --packages-up-to only compiles the specified package and all its dependencies, but does not build the entire workspace (saving time) --symlink-install avoids every adjustment All python scripts need to be rebuilt --event-handlers console_direct+ Display the console output when generated (otherwise it can be found in the "log" directory)
After compiling, remember to take effect, similar to the source in ROS1
#执行覆盖
. install/local_setup.bash
5.5 Modify the code and use the network port mode
cd ~/SensorWS/Nvistar_Ros2ws/src/nvilidar_ros2/params
vim nvilidar.yaml
original:
After modification:
Modify nvilidar_ros2_node.cpp file
After modification:
Because the code has been modified, remember to recompile
cd ~/SensorWS/Nvistar_Ros2ws/
#编译
colcon build
If there is an alarm, you can ignore it.
5.6 Run the test node and view the point cloud
cd ~/SensorWS/Nvistar_Ros2ws/
#执行覆盖
. install/local_setup.bash
#启动脚本文件
ros2 launch nvilidar_ros2 nvilidar_launch.py
You can see that the program has started and started scanning
We can open a new window to check the basic information of nodes and topics
cd ~/SensorWS/Nvistar_Ros2ws/
#执行覆盖
. install/local_setup.bash
ros2 node list -------------------------------------------------------------------------------- /launch_ros_15285 /nvilidar_ros2_node /static_tf_pub_laser ros2 node info /nvilidar_ros2_node -------------------------------------------------------------------------------- /nvilidar_ros2_node Subscribers: /parameter_events: rcl_interfaces/msg/ParameterEvent Publishers: /parameter_events: rcl_interfaces/msg/ParameterEvent /rosout: rcl_interfaces/msg/Log /scan: sensor_msgs/msg/LaserScan Service Servers: /nvilidar_ros2_node/describe_parameters: rcl_interfaces/srv/DescribeParameters /nvilidar_ros2_node/get_parameter_types: rcl_interfaces/srv/GetParameterTypes /nvilidar_ros2_node/get_parameters: rcl_interfaces/srv/GetParameters /nvilidar_ros2_node/list_parameters: rcl_interfaces/srv/ListParameters /nvilidar_ros2_node/set_parameters: rcl_interfaces/srv/SetParameters /nvilidar_ros2_node/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically Service Clients: Action Servers: Action Clients:
To view the point cloud, we can directly use the script file provided by the official, directly run the node and open it to view the electric cloud, which will be much simpler. Remember to close previously opened nodes.
Run the following command in the terminal of nomachine
cd ~/SensorWS/Nvistar_Ros2ws/
#执行覆盖
. install/local_setup.bash
#启动脚本文件
ros2 launch nvilidar_ros2 nvilidar_launch_view.py
6. Summary
This is the first time I have used ROS2 eloquent to test a hardware device completely, so in the process of re-testing, I actually read a lot of previous records myself, and found that it is still a practical completion process, which can deepen my understanding of ROS2. Understand and be familiar with its operation and common instructions.
ROC 300's ROS2 and ROS1 driver support is still very good, this must give a good review. The second is the radar. I support driving it in a test environment and preparing to run it overnight to see its stability.
The price-performance ratio of this radar is still very suitable for educational and commercial robot products. It is light and lightweight, especially the design of the USB interface. It can be seen that the designer has paid attention to the actual stable and reliable use. Give it a good review.
Error correction, questions, communication: [email protected]