Jetbot road following data collection docker container exception

Hello, I get an error early on in running this container.

Does anyone have a suggestion to get this going?

Exception in thread Thread-4:
Traceback (most recent call last):
File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/usr/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py”, line 45, in _capture_frames
self.value = image
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 588, in set
self.set(obj, value)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 577, in set
obj._notify_trait(self.name, old_value, new_value)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1210, in _notify_trait
type=‘change’,
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1215, in notify_change
return self._notify_observers(change)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1252, in _notify_observers
c(event)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 361, in _update
self._transform(change.new))
File “”, line 19, in display_xy
image = cv2.circle(image, (widget_width / 2, widget_height), 8, (0, 0,255), 3)
TypeError: integer argument expected, got float

TypeErrorTraceback (most recent call last)
in
24 time.sleep(1)
25 traitlets.dlink((camera, ‘value’), (image_widget, ‘value’), transform=bgr8_to_jpeg)
—> 26 traitlets.dlink((camera, ‘value’), (target_widget, ‘value’), transform=display_xy)
27
28 display(widgets.HBox([image_widget, target_widget]), x_slider, y_slider)

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in init(self, source, target, transform)
337 _validate_link(source, target)
338 self.source, self.target = source, target
→ 339 self.link()
340
341 def link(self):

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in link(self)
342 try:
343 setattr(self.target[0], self.target[1],
→ 344 self._transform(getattr(self.source[0], self.source[1])))
345 finally:
346 self.source[0].observe(self._update, names=self.source[1])

in display_xy(camera_image)
17 y = int(y * widget_height / 2 + widget_height / 2)
18 image = cv2.circle(image, (x, y), 8, (0, 255, 0), 3)
—> 19 image = cv2.circle(image, (widget_width / 2, widget_height), 8, (0, 0,255), 3)
20 image = cv2.line(image, (x,y), (widget_width / 2, widget_height), (255,0,0), 3)
21 jpeg_image = bgr8_to_jpeg(image)

TypeError: integer argument expected, got floatException in thread Thread-4:
Traceback (most recent call last):
File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/usr/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py”, line 45, in _capture_frames
self.value = image
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 588, in set
self.set(obj, value)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 577, in set
obj._notify_trait(self.name, old_value, new_value)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1210, in _notify_trait
type=‘change’,
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1215, in notify_change
return self._notify_observers(change)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1252, in _notify_observers
c(event)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 361, in _update
self._transform(change.new))
File “”, line 19, in display_xy
image = cv2.circle(image, (widget_width / 2, widget_height), 8, (0, 0,255), 3)
TypeError: integer argument expected, got float

TypeErrorTraceback (most recent call last)
in
24 time.sleep(1)
25 traitlets.dlink((camera, ‘value’), (image_widget, ‘value’), transform=bgr8_to_jpeg)
—> 26 traitlets.dlink((camera, ‘value’), (target_widget, ‘value’), transform=display_xy)
27
28 display(widgets.HBox([image_widget, target_widget]), x_slider, y_slider)

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in init(self, source, target, transform)
337 _validate_link(source, target)
338 self.source, self.target = source, target
→ 339 self.link()
340
341 def link(self):

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in link(self)
342 try:
343 setattr(self.target[0], self.target[1],
→ 344 self._transform(getattr(self.source[0], self.source[1])))
345 finally:
346 self.source[0].observe(self._update, names=self.source[1])

in display_xy(camera_image)
17 y = int(y * widget_height / 2 + widget_height / 2)
18 image = cv2.circle(image, (x, y), 8, (0, 255, 0), 3)
—> 19 image = cv2.circle(image, (widget_width / 2, widget_height), 8, (0, 0,255), 3)
20 image = cv2.line(image, (x,y), (widget_width / 2, widget_height), (255,0,0), 3)
21 jpeg_image = bgr8_to_jpeg(image)

TypeError: integer argument expected, got

cv2.line and cv2.circle need integer coordinates, then make sure that widget_width and widget_height are integer.
And “widget_width // 2” than “widget_width / 2”.

Cool, thanks, I think the error got shorter.
I tried setting to int, but I am doing something wrong with the syntax, I will work on it and see what happens

I have seen plenty of videos of this notebook working, did something change in jetpack 4.5 that would cause this to break somehow?

Exception in thread Thread-4:
Traceback (most recent call last):
File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/usr/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py”, line 45, in _capture_frames
self.value = image
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 588, in set
self.set(obj, value)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 577, in set
obj._notify_trait(self.name, old_value, new_value)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1210, in _notify_trait
type=‘change’,
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1215, in notify_change
return self._notify_observers(change)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 1252, in _notify_observers
c(event)
File “/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py”, line 361, in _update
self._transform(change.new))
File “”, line 19, in display_xy
image = cv2.circle(image, (widget_width / 2, widget_height / 2), 8, (0, 0,255), 3)
TypeError: integer argument expected, got float

TypeErrorTraceback (most recent call last)
in
24 time.sleep(1)
25 traitlets.dlink((camera, ‘value’), (image_widget, ‘value’), transform=bgr8_to_jpeg)
—> 26 traitlets.dlink((camera, ‘value’), (target_widget, ‘value’), transform=display_xy)
27
28 display(widgets.HBox([image_widget, target_widget]), x_slider, y_slider)

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in init(self, source, target, transform)
337 _validate_link(source, target)
338 self.source, self.target = source, target
→ 339 self.link()
340
341 def link(self):

/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in link(self)
342 try:
343 setattr(self.target[0], self.target[1],
→ 344 self._transform(getattr(self.source[0], self.source[1])))
345 finally:
346 self.source[0].observe(self._update, names=self.source[1])

in display_xy(camera_image)
17 y = int(y * widget_height / 2 + widget_height / 2)
18 image = cv2.circle(image, (x, y), 8, (0, 255, 0), 3)
—> 19 image = cv2.circle(image, (widget_width / 2, widget_height / 2), 8, (0, 0,255), 3)
20 image = cv2.line(image, (x,y), (widget_width / 2, widget_height / 2 ), (255,0,0), 3)
21 jpeg_image = bgr8_to_jpeg(image)

TypeError: integer argument expected, got float

Sorry I do not have any idea if 4.5 has some change for Jetbot.

Well, I just copied and pasted the code from github into jupyter notebook within the docker container, and the error is the same.

I just ran through all of the folders really quick. everything seems to work except for road following, and object following.

If anyone else has a jetbot with jp4.5 try out the gamepad data collection notebook for road following.

Hi All,

Thanks for sharing your resolution to this issue.

We’ve validated that the integer fix recommended by @MtHiker works, and have created an issue on GitHub to track this.

It will likely be some time before this appears in a new JetBot SD card image release, since this is a more time consuming process.

For the time being, we recommend either manually applying this fix, or switching to use the “clickable widget” version of the data collection notebook.

Please let me know if you have any questions or comments.

Best,
John