2

i am working on a neural network project via ROS, i want to know how to process lidar data directly to neural network via tensorflow and keras on python

How can i subscribe the lidar data in ROS and works it with keras or tensorflow directly?

i just know how to use the data for neural network when its converted into .csv (using rosbag_to_csv).

dataset = loadtxt('lidar.csv', delimiter=',')

X = dataset[:,0:360]
y = dataset[:,1]

model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

where i can put the topic address /scan in my python code?

i am using

  • kinetic
  • ubuntu 16.04
  • python 2.7
Anto
  • 61
  • 7
  • You would essentially use the subscriber in place of where data is being read from a csv. Can you provide the code you have that works? – BTables Nov 04 '21 at 16:52
  • i have edited my question, i was try to change the dataset to lidar topic but i dont know the exactly how the code will works (if i use the data directly from sensor), i use 2d lidar with 360 data in once process – Anto Nov 05 '21 at 02:22
  • What does `dataset` or `lidar.csv` roughly look like? I assume the former isn't just a list of the `uint8 data` field from a pointcloud2 message? Because using tuples to slice is not valid syntax – BTables Nov 05 '21 at 02:48
  • its contain many data such as time max-min range etc. I just want to proceed the ranges data, before i proceed, i edit them (i know it sounds silly). – Anto Nov 05 '21 at 05:22

0 Answers0