Closed likun1993630 closed 4 years ago
@likun1993630 - Please echo the topic /tcp_tx
and see if there are any data. If there are no data on /tcp_tx
, then the network interface is not working correctly. If there are data on /tcp_tx
, then continue.
Next, echo the topic /parsed_tx/scan_data_2204
and /parsed_tx/scan_data_2205
. One of these topics should be producing data, depending on the version of the software on your Fusion ECU. If neither of these are producing data, then there is something wrong with the driver parsing the raw TCP data from the Fusion ECU. If one of these has data, then there is something wrong with the driver producing the point cloud.
Thank you for the detailed bug report!
@JWhitleyAStuff - Thank you very much for your quick reply, I will try out your suggestions.
@JWhitleyAStuff Hi, I have tested this package again, and the final conclusion is that network_interface is not working.
The first is that the /tcp_tx topic has not been published.
Then I did some other tests on the code and found that the msg_buf container is empty. I guess the possible reason is that the fusion ECU did not receive the correct command to send the sensor data, or sent the command correctly, but the ECU did not make response.
So I used software(Wireshark) to detect the entire process of TCP communication and found the problem:
The read() function can not read data from socket buffer in kernel space to msg_buf, so msg_buf is empty. https://github.com/astuff/ibeo_lux/blob/966ecbf2d41db37c39604fcfa1a4d8b1e3631ec1/src/ros_ibeo_lux.cpp#L189 https://github.com/astuff/network_interface/blob/48d0111c3024ce9206846e361773c65db4a38f1b/src/tcp_interface.cpp#L70-L87
Here are some information from wireshark:
The endpoint of ubuntu-PC is: IP 192.168.0.10 , port 46638
The above lines 1-3 indicate that the connection between ubuntuPC and ECU has been correctly established;
The fourth line is the command that ubuntu-PC sends to the ECU:
{0xaf, 0xfe, 0xc0, 0xc2,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x20, 0x10,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x05, 0x00, 0x02,
0x00, 0x00, 0xff, 0xff}
Starting from the tenth line, the ECU began sending a large amount of data to the ubuntu-PC.
It can be seen from the above that since the contents of the socket buffer cannot be read by C++ code, they are gradually filled up until the error messages of Window Full and ZeroWindow appear.
I guess the cause of this problem is the msg_buf initialization problem.
I suspected that this might be caused by the initialization of buf_msg, so I tried to initialize buf_msg as a large enough container before writing the contents of the socket buffer to buf_msg, instead of just requesting to reserve some continuous memory space.
https://github.com/astuff/ibeo_lux/blob/966ecbf2d41db37c39604fcfa1a4d8b1e3631ec1/src/ros_ibeo_lux.cpp#L186 Change the above code to:
std::vector<uint8_t> msg_buf(10000000,0); //10Mb buffer
After the change, the /tcp tx topic can already publish the message. In addition, only the following two topics have appeared:
/as_tx/objects
/as_tx/object_contour_points
There was no data on all other topics.
Other topics have not been published, I guess it is caused by the ecu firmware update.
I am looking forward to knowing if you have any thoughts on this issue or have any suggestions for dealing with this issue.
In addition, our ECU has been upgraded to 2019-R1_v8.0.0. In this new firmware, new data such as 2209 is sent. I wonder if you intend to adapt this package to the latest firmware.
Thanks very much!
I have also encounter this problem , There were also no messages sent from Node.
@JWhitleyAStuff @bensort I have solved the problem I have encountered. In other words, this package can already publish the required topics.
The firmware version of my fusion ECU is 2019-R1_v8.0.0. In this version, if a command to request all sensor data is sent to the Fusion ECU, the raw tcp messages that the Ubuntu PC can receive are(checked with wireshark): 0x9001 0x6701 0x2807 0x2209 0x2280
After I modified the source code, the following topics were published:
As_tx/object_contour_points
As_tx/objects
As_tx/point_cloud
Parsed_tx/host_vehicle_state_2807
Parsed_tx/object_data_2280
Parsed_tx/scan_data_2209
Tcp_tx
https://github.com/astuff/network_interface/blob/48d0111c3024ce9206846e361773c65db4a38f1b/src/tcp_interface.cpp#L77 Change the above line to:
msg->resize(socket_.available(),0);
/* I have read the doc of the boost.asio library.
I personally think that the vector container needs to be properly initialized first, that is, allocate memory.
Then it can be passed to the buffer function.*/
/* Since the raw tcp data needs to be combined,so I use the function that returns the size of the available data in socket buffer.
(The scan data is very large. The read() function may take several times to read data from the socket buffer to form a complete scan data.Only the complete scan data can be parsed correctly).*/
If your firmware version is the same as mine (latest version). After this change, there will be the following topics that can be published: Tcp_tx As_tx/object_contour_points As_tx/objects
Change the keyword 2205 of the source code in all following packages to 2209, including the msg file content, msg file name and CmakeLists:
astuff_sensor_msgs/ibeo_msgs/
ibeo_core/
ibeo_lux/
Change the parse function of class ScanData2209:
scan_points = read_be<uint32_t>(in, hdr + 18);
number_of_scanner_infos = read_be<uint8_t>(in, hdr + 22);
new_scanner_info.parse(in, hdr + 26 + (i * 148));
new_scan_point.parse(in, hdr + 26 + (number_of_scanner_infos * 148) + (i * 28));
After this change, As_tx/point_cloud will be published.
https://github.com/astuff/ibeo_lux/blob/966ecbf2d41db37c39604fcfa1a4d8b1e3631ec1/include/ibeo_lux/ibeo_lux_ros_msg_handler.h#L27 https://github.com/astuff/ibeo_lux/blob/966ecbf2d41db37c39604fcfa1a4d8b1e3631ec1/src/ibeo_lux_ros_msg_handler.cpp#L18
Change codes to: (uint8_t to uint16_t):
void fillAndPublish(const uint16_t& type_id,
const std::string& frame_id,
const ros::Publisher& pub,
IbeoTxMessage * parser_class);
void IbeoLuxRosMsgHandler::fillAndPublish(
const uint16_t& type_id,
const std::string& frame_id,
const ros::Publisher& pub,
IbeoTxMessage * parser_class)
the reason for it, see code:
After this change, there will be the following topics that can be published: Parsed_tx/host_vehicle_state_2807 Parsed_tx/object_data_2280 Parsed_tx/scan_data_2209
(微信likun1993630)
@likun1993630 Thank you for all of your work on this issue! Can you please test your modifications to ibeo_core
and ibeo_lux
using the version of network_interface
here: https://github.com/astuff/network_interface/pull/26 ?
I tried it, the problem that node did not post the message has been solved. thanks:)
@likun1993630 Now that the issue with network_interface
has been solved, we will test internally and create a new release. Could you possibly create a new Pull Request on this repo to add the additional messages you mention above? However, instead of modifying an existing message, please have the driver publish this as a new message/topic. We still have users with older versions of the Fusion software which will publish the other messages and we do not want to remove them from the package. I would really appreciate it!
@JWhitleyAStuff I will finish it this weekend.
@likun1993630 - astuff/network_interface#26 is merged. I will release a new version to the ROS Build Farm as soon as we have done testing internally.
Hi,I would like to use this ROS package to communicate the IBEO Fusion-ECU. But I encounter some problems.
Briefly, Node does not output anything.
The ECU is connected with four IBEO lux 4l sensors. The ECU's IP is default, 192.168.1.100, and the port number is 12002.
A Ubuntu-PC was connected to Fusion ECU directly.
Thanks very much !
Here are my steps for installation and startup:
install driver package
modify the ibeo_lux.launch file
Setting of Ubuntu PC
IP: 192.168.0.10
mask: 255.255.255.0
Gateway: 0.0.0.0 (or nothing)
Then the Ubuntu PC was connected to FusionECU with Ethernet cable.
View network status with
ifconfig
Test connection with
ping
Start ibeo_lux Node
There were also no messages sent from Node, eg: