-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How About Direct Connection to LiDAR and read the PCAP Stream from Static IP address without Using ROS? #4
Comments
I have not tried that myself, but it should be quite straightforward with the existing tools. Something like this: import velodyne_decoder as vd
import socket
import sys
import time
def read_live_data(ip, port, config, as_pcl_structs=False):
decoder = vd.StreamDecoder(config)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((ip, port))
while True:
data, address = s.recvfrom(vd.PACKET_SIZE * 2)
recv_stamp = time.time()
yield decoder.decode(recv_stamp, data, as_pcl_structs)
if __name__ == "__main__":
ip = sys.argv[1]
port = sys.argv[2]
config = vd.Config(model="VLP-16", rpm=600)
for stamp, points in read_live_data(ip, port, config):
print(stamp, points.shape) Let me know if that works and I might add this to the library as well. |
Thanks! Just checked, your code works with some modifications.
Thank you for your help! I will acknowledge your efforts in my paper (if any)! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now we have successfully connect our Jetson Orin to the LiDAR device and we can use tcpdump to generate .pcap files without involving ROS. (.pcap files are just the network traffic packages) However, to test real-time processing, we would like to directly analyze the LiDAR stream instead of saving and then analyzing the pcap files. May I ask how to directly use the IP address and maybe port number as LiDAR input?
The text was updated successfully, but these errors were encountered: