Hello,
I save images from a camera into csv file and I found that there are images with same seq number even though trigger is set to the camera.
The (minimal) code seems like that
@nrp.Robot2Neuron(triggers="camera_left") #trigger is set to a camera
def sensor_collector(t, visual_recorder, camera_left, position_service):
ball_msg = [position_service.value('ball', 'world')]
camera_left_msg = [camera_left.value]
position_x = ball_msg[0].pose.position.x #position of the ball
visual_recorder.record_entry(camera_left_msg[0], position_x) #save into csv file
In csv file I can see 2 records with the same image and different position_x… for example,
header:
seq: 14
stamp:
secs: 2
nsecs: 602010000
... other info
data: [55, 56, IMAGE..138],1.515..
header: #next record
seq: 14 #same seq
stamp: #same stamp
secs: 2
nsecs: 602010000
... other info
data: [55, 56,.SAME IMAGE..138], 1.517..
Therefore, it seems that the camera trigger runs twice for same image. Is there any way how to run the collector only once for an image and avoid multiple records with same seq number?
Thank you in advance
Zdenek