Closed weiOverlord closed 1 month ago
Hi, first of all, 16.04 is a fairly old system that might not have all dependencies. However, if it builds, it might work especially if the ROS1 driver works. I don't see an immediate mistake in your code. As far as I understand it, the callback (CB) is never called, and no data has arrived. You could take a look into the ROS2 driver, that utilizes the base C++ driver. You can find the code here https://github.com/SICKAG/sick_safetyscanners2/blob/master/src/SickSafetyscanners.cpp#L124, and the setup of the communication is invoked from here: https://github.com/SICKAG/sick_safetyscanners2/blob/master/src/SickSafetyscannersRos2.cpp#L70
I am very glad to receive your reply. I am very sorry. For NanoScan3 radar, we do not use ROS framework for development, and we just want to use C++ version driver to establish communication with the radar. Also, why does running ROS1 on Ubuntu16.04 allow you to connect to radar and get data?
1059482396 @.***
------------------ 原始邮件 ------------------ 发件人: "SICKAG/sick_safetyscanners_base" @.>; 发送时间: 2024年10月16日(星期三) 晚上8:26 @.>; @.**@.>; 主题: Re: [SICKAG/sick_safetyscanners_base] The c++ version driver has no data connected to the li (Issue #32)
Hi, first of all, 16.04 is a fairly old system that might not have all dependencies. However, if it builds, it might work especially if the ROS1 driver works. I don't see an immediate mistake in your code. As far as I understand it, the callback (CB) is never called, and no data has arrived. You could take a look into the ROS2 driver, that utilizes the base C++ driver. You can find the code here https://github.com/SICKAG/sick_safetyscanners2/blob/master/src/SickSafetyscanners.cpp#L124, and the setup of the communication is invoked from here: https://github.com/SICKAG/sick_safetyscanners2/blob/master/src/SickSafetyscannersRos2.cpp#L70
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
The base driver and the ROS1 driver diverged at some stage; they are not the same; the base driver is the newer version and is the basis for the ROS2 driver. Could you elaborate on the complete log output of your program? So that I get an understanding of what is happening.
When I used the C++ driver, I could normally connect with the nanoscan3 driver. I checked the TCP connection and got the port number, but no data was sent. Now I don't know which direction to check, I compared the parameters of ROS driver. The parameters of the Commetting class are almost the same, but I do not understand why no data is sent
1059482396 @.***
------------------ 原始邮件 ------------------ 发件人: "SICKAG/sick_safetyscanners_base" @.>; 发送时间: 2024年10月16日(星期三) 晚上9:39 @.>; @.**@.>; 主题: Re: [SICKAG/sick_safetyscanners_base] The c++ version driver has no data connected to the li (Issue #32)
The base driver and the ROS1 driver diverged at some stage; they are not the same; the base driver is the newer version and is the basis for the ROS2 driver. Could you elaborate on the complete log output of your program? So that I get an understanding of what is happening.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Can you see packages being transmitted in wireshark? to the correct IP address and port? And could you give the parameters you set?
I don't quite understand what you mean. I compared the configuration parameters of ROS driver with those of C++, and they are almost the same, but the results are different. Therefore, I would like to trouble you to try C++ driver and follow the main() function written by me to see if you can find out where the problem is.
------------------ 原始邮件 ------------------ 发件人: "SICKAG/sick_safetyscanners_base" @.>; 发送时间: 2024年10月16日(星期三) 晚上9:45 @.>; @.**@.>; 主题: Re: [SICKAG/sick_safetyscanners_base] The c++ version driver has no data connected to the li (Issue #32)
Can you see packages being transmitted in wireshark? to the correct IP address and port? And could you give the parameters you set?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Try adding these lines around your Async client, it might be that the comm_settigns are rejected by the sensor, since they are the wrong type, by reading the type from the sensor and updating it, it should work
auto safety_scanner = std::make_unique<sick::AsyncSickSafetyScanner>(sensor_ip, tcp_port, comm_sett ings, cb);
sick::datastructure::TypeCode type_code;
safety_scanner->requestTypeCode(type_code);
comm_settings.e_interface_type = type_code.getInterfaceType();
safety_scanner->run();
safety_scanner->changeSensorSettings(comm_settings);
I understand. I will try it tomorrow morning. Thank you very much for your help. I will inform you immediately if there is any result. Thanks again
1059482396 @.***
------------------ 原始邮件 ------------------ 发件人: "SICKAG/sick_safetyscanners_base" @.>; 发送时间: 2024年10月16日(星期三) 晚上10:57 @.>; @.**@.>; 主题: Re: [SICKAG/sick_safetyscanners_base] The c++ version driver has no data connected to the li (Issue #32)
Try adding these lines around your Async client, it might be that the comm_settigns are rejected by the sensor, since they are the wrong type, by reading the type from the sensor and updating it, it should work
auto safety_scanner = std::make_unique<sick::AsyncSickSafetyScanner>(sensor_ip, tcp_port, comm_sett ings, cb); sick::datastructure::TypeCode type_code; safety_scanner->requestTypeCode(type_code); comm_settings.e_interface_type = type_code.getInterfaceType(); safety_scanner->run(); safety_scanner->changeSensorSettings(comm_settings);
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>
As far as I understood it, this resolved the issue. Therefore closing it
Yes, the problem has been solved. Now that part of the code has been added, and the data is available now. Thank you very much for your help! Yes, the problem has been solved. Now that part of the code has been added, and the data is available now. Thank you very much for your help!
1059482396 @.***
------------------ 原始邮件 ------------------ 发件人: "SICKAG/sick_safetyscanners_base" @.>; 发送时间: 2024年10月17日(星期四) 下午5:23 @.>; @.**@.>; 主题: Re: [SICKAG/sick_safetyscanners_base] The c++ version driver has no data connected to the li (Issue #32)
Closed #32 as completed.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Hello, when I used the c++ version driver code to connect the nanoscan3 radar, no data was sent out when I printed data. The c++ driver download address is: https://www.sick.com/cn/zh/catalog/products/safety/safety-laser-scanners/nanoscan3/nans3-caaz30an1/p/p653980?category=g5 69793&tab=downloads The name is C++ library for safety laser scanners I downloaded the C++ nanoscan3 driver code from this path,When I use this driver, I only add content to the main function, and nothing else changes. The contents are as follows:
int mai() { std::string sensor_ip_str = "192.168.192.10"; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
return 0; }
ROS driver: https://github.com/SICKAG/sick_safetyscanners
So when I started the drive, only one prompt appeared,as follows: [INFO]: Command Method Acknowledged
I tried again to print the log in the UDPClient.cpp file, and when I used the isConnected() function, the connection status returned True. The port number is also returned when the connection port is obtained using the getLocalPort function.When I checked the PacketBuffer.cpp file again,When I checked the PacketBuffer.cpp file again and printed the length of m_buffer in the setBuffer(const std::vector&buffer) function, the output was as follows:
18
18
24
24
18
18