asrob-uc3m / rd2

RD2
0 stars 0 forks source link

RD2 revival #1

Open jgvictores opened 6 years ago

jgvictores commented 6 years ago

From @jgvictores on May 13, 2018 10:18

RD2 revival

Robot: https://github.com/asrob-uc3m/robotDevastation-robots/tree/develop/rd2 (permalink).

Prototype status: in robotera.

Copied from original issue: asrob-uc3m/robotDevastation#134

jgvictores commented 6 years ago

Will be focusing on other robots for now, namely RD Ambassador https://github.com/asrob-uc3m/rd-ambassador/issues/1 as it is easy to build (you buy the chassis). :smile:

jgvictores commented 6 years ago

import->export to https://github.com/asrob-uc3m/rd2

PeterBowman commented 5 years ago

The command protocol has changed in the last months; therefore, the robot server device run aboard the RD2 robot needs to be updated. Sadly, the CPU is a kinda old RasPi v2 with one single core and outdated packages, for instance, CMake 2.8.9. This means that a git pull of the yarp-devices repo will deliver code that cannot be built with that software. The long term goal should be either migrating to a newer SO (not sure how this goes in the RasPi world) or replacing the CPU with, say, a modern RasPi V3(B). In the meantime, I'll try to backport the new interface/protocol in the commit tree that still worked on YARP 2.3.68.

jgvictores commented 5 years ago

From https://github.com/asrob-uc3m/robotDevastation-robots/issues/44 I see that for RD Ambassador at https://github.com/asrob-uc3m/rd-ambassador/issues/1 we have newer Raspis (v2 or even v3b) with Raspian Stretch. Raspian versions are equal to Debian's so https://packages.debian.org/stretch/cmake says we would have a nice cmake 3.7.2-1.

PeterBowman commented 5 years ago

In the meantime, I'll try to backport the new interface/protocol in the commit tree that still worked on YARP 2.3.68.

I'd start with the repo state previous to commit https://github.com/asrob-uc3m/yarp-devices/commit/9f777d1b0eea82ffad8769307abc37f3361af598 (CMake bumped from 2.8.9 to 3+) and cherry pick https://github.com/asrob-uc3m/yarp-devices/commit/341a73c99f794567cf872485c04e159583a0f2f8.

PeterBowman commented 5 years ago

Due to working with a one-core Raspi v2, I thought it would be nice to switch SDs with a Raspi v3, but that one only handles MicroSD, while RD2 has a full-sized SD. Apart from that, I have switched from gcc-4.6 to gcc-4.8 (C++11 feature-ready).

jgvictores commented 5 years ago

We could work with the microSD on Raspi v3, then fit it in an adapter (there are some in locker 1) for the SD of Raspi v2.

PeterBowman commented 5 years ago

At the time of writing, RD2 runs CMake 3.5.2 (no ccmake, yet), YARP 2.3.72.1 with opencv_grabber and the mjpeg carrier, and latest rd-robots and yarp-devices repos. A linker issue was solved via https://github.com/asrob-uc3m/yarp-devices/commit/7db08bd3433396097e43ef8fc3906a62d2387a94. However, https://github.com/asrob-uc3m/rd2/issues/2 and https://github.com/asrob-uc3m/rd2/issues/3 are now blocking further progress.

PeterBowman commented 5 years ago

We could work with the microSD on Raspi v3, then fit it in an adapter (there are some in locker 1) for the SD of Raspi v2.

I forgot to say that this didn't work due to not being able to log in the RasPi v3 (this solution suggested by @jgvictores on chat would require a working keyboard+display). I decided to spend a few hours compiling stuff (CMake took circa 1.5 hours, YARP was 2+).

However, #2 and #3 are now blocking further progress.

Done. Was caused by some obsolete .ini files, which leads us to...

Incorporate custom https://github.com/asrob-uc3m/robotDevastation-robots/tree/develop/scripts

In the first place, I think we should import robotDevastation-robots/share/launch, which actually holds the RD2-related port names and pinout configuration. However, this repository (as other similar robot-oriented) stores 3D models, schematics, pictures, etc. which I'm not especially eager to clone into the onboard RD2's storage just for the sake of copying a few tiny launcher scripts into some system location. Perhaps all config files should remain in robotDevastation-repos, conveniently renamed so that name clashes and conflicts are avoided? @jgvictores I believe you share some of my concerns given https://github.com/asrob-uc3m/robotDevastation-developer-manual/issues/12.

PS see https://github.com/asrob-uc3m/robotDevastation-developer-manual/issues/12#issuecomment-441367312.

jgvictores commented 5 years ago

8GB SDHC (large)

Attaching pic of this 8GB SDHC (large) (EDIT: Currently has Rasbian 7, we want 9) photo_2019-04-03_17-48-59

PeterBowman commented 5 years ago

It's really large! (You can fit so many wonders into 8 GB.)

jgvictores commented 5 years ago

Updated description on Prototype status: in robotera.

jgvictores commented 5 years ago
  • Other issues are regarding number of USBs (only 2, used by camera and wifi) and not accesible without unscrewing

Attaching pic that illustrates this fact photo_2019-04-03_18-34-32

jgvictores commented 5 years ago

Also attaching pic of electronics (we're note really sure if it's correct, but at least for now it hasn't crashed on init nor smelt like burnt)

EDIT: Connection seems correct given pinout in inner row:

photo_2019-04-03_17-49-22

jgvictores commented 5 years ago

Copying Raspi v3b+ contents from microSD to Toshiba 16 GB SD (preserving Lexar 8 GB SD) as explained at http://wiki.asrob.uc3m.es/index.php/Crear_SD_con_Raspbian_y_robotDevastation-robots/raspi_software_(avanzado:_de_cero).

Note: Pending https://github.com/asrob-uc3m/robotDevastation-developer-manual/issues/13) where documentation is being migrated to https://github.com/asrob-uc3m/robotDevastation-developer-manual/tree/master/robots (perma).

jgvictores commented 5 years ago

Replicated steps with big Toshiba 16 GB SD (fsarchiver and fdisk as explained staring at https://github.com/asrob-uc3m/rd-ambassador/issues/1#issuecomment-503223715) and got booting Raspian 9. :tada:

photo_2019-06-25_21-03-53

jgvictores commented 4 years ago

Turned on today. Raspian 9.8 (stretch). Regarding the two USB ports:

jgvictores commented 4 years ago

Raspian 9.8 (stretch) comes with cmake version 3.7.2, while YARP requires CMake 3.12 or higher. As https://apt.kitware.com/ PPA looks very Ubuntu-oriented, https://packages.debian.org/stretch-backports/cmake providing 3.16.3-1~bpo9+1 looks like a reasonable option.

jgvictores commented 4 years ago

Raspian doesn't release official backports. Ended up compiling cmake (v3.17.2) from source. More than 6 hours on a single-core Raspi 1 (following https://github.com/roboticslab-uc3m/installation-guides/blob/31a01a0390b681f3ce4151d8cba1b8512ae3693c/install-cmake.md#openssl-support-older-distros-and-building-from-sources):

real    368m59.732s
user    330m55.951s
sys     24m16.750s
jgvictores commented 4 years ago

On branch yarp-3.3:

[100%] Building CXX object src/yarpdatadumper/CMakeFiles/yarpdatadumper.dir/main.cpp.o
/home/pi/repos/yarp/src/yarpdatadumper/main.cpp: In member function ?virtual void DumpThread::run()?:                                                                                                       
/home/pi/repos/yarp/src/yarpdatadumper/main.cpp:489:52: error: ?fourcc? is not a member of ?cv::VideoWriter?
                 videoWriter.open(videoFile.c_str(),cv::VideoWriter::fourcc('H','F','Y','U'),                                                                                                               
                                                    ^~
src/yarpdatadumper/CMakeFiles/yarpdatadumper.dir/build.make:82: recipe for target 'src/yarpdatadumper/CMakeFiles/yarpdatadumper.dir/main.cpp.o' failed                                                      
make[2]: *** [src/yarpdatadumper/CMakeFiles/yarpdatadumper.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:5759: recipe for target 'src/yarpdatadumper/CMakeFiles/yarpdatadumper.dir/all' failed                                                                                                  
make[1]: *** [src/yarpdatadumper/CMakeFiles/yarpdatadumper.dir/all] Error 2
Makefile:171: recipe for target 'all' failed                                                                                                                                                                
make: *** [all] Error 2

real    267m51.271s
user    245m42.829s                                                                                                                                                                                         
sys     14m15.315s
jgvictores commented 4 years ago

Via cmake .. -DYARP_COMPILE_yarpdatadumper:BOOL=OFF (continuing single-core make from where left off):

[100%] Built target yarpmanager-console                                                                                                                                                                     

real    0m50.334s                                                                                                                                                                                           
user    0m31.973s
sys     0m16.286s   
jgvictores commented 4 years ago

After installing dependencies, asrob-uc3m/yarp-devices was:

[100%] Built target RobotServer

real    9m45.548s
user    8m42.032s
sys     0m43.627s
jgvictores commented 4 years ago

Wow! Raspi 3 B+ (nproc=4) compiled cmake (v3.17.2) in less than 20 min (compare to the more than 6 hours on Raspi 1 at https://github.com/asrob-uc3m/rd2/issues/1#issuecomment-629841963).

jgvictores commented 4 years ago

Compiling on Raspi 3 B+ but same setup as https://github.com/asrob-uc3m/rd2/issues/1#issuecomment-630006626; yes, yarp-3.3 compiles without GUIs, but it turns out there is an issue with the MJPEG carrier (for the record, using libjpeg8-dev):

/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:66:80: error: ‘JCS_EXT_RGBA’ was not declared in this scope
                                                            {VOCAB_PIXEL_RGBA , JCS_EXT_RGBA},
                                                                                ^~~~~~~~~~~~
/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:67:80: error: ‘JCS_EXT_BGRA’ was not declared in this scope
                                                            {VOCAB_PIXEL_BGRA , JCS_EXT_BGRA},
                                                                                ^~~~~~~~~~~~
/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:68:79: error: ‘JCS_EXT_BGR’ was not declared in this scope
                                                            {VOCAB_PIXEL_BGR , JCS_EXT_BGR} };
                                                                               ^~~~~~~~~~~
/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:68:92: error: no matching function for call to ‘std::map<int, J_COLOR_SPACE>::map(<brace-enclosed initializer list>)’
                                                            {VOCAB_PIXEL_BGR , JCS_EXT_BGR} };
                                                                                            ^
In file included from /usr/include/c++/6/map:61:0,
                 from /home/pi/repos/yarp/src/libYARP_sig/src/yarp/sig/Image.h:19,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegStream.h:18,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.h:16,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:45:
/usr/include/c++/6/bits/stl_map.h:273:9: note: candidate: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&)
         map(_InputIterator __first, _InputIterator __last,
         ^~~
/usr/include/c++/6/bits/stl_map.h:273:9: note:   template argument deduction/substitution failed:
/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:68:92: note:   candidate expects 4 arguments, 6 provided
                                                            {VOCAB_PIXEL_BGR , JCS_EXT_BGR} };
                                                                                            ^
In file included from /usr/include/c++/6/map:61:0,
                 from /home/pi/repos/yarp/src/libYARP_sig/src/yarp/sig/Image.h:19,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegStream.h:18,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.h:16,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:45:
/usr/include/c++/6/bits/stl_map.h:256:9: note: candidate: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator)
         map(_InputIterator __first, _InputIterator __last)
         ^~~
/usr/include/c++/6/bits/stl_map.h:256:9: note:   template argument deduction/substitution failed:
/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:68:92: note:   candidate expects 2 arguments, 6 provided
                                                            {VOCAB_PIXEL_BGR , JCS_EXT_BGR} };
                                                                                            ^
In file included from /usr/include/c++/6/map:61:0,
                 from /home/pi/repos/yarp/src/libYARP_sig/src/yarp/sig/Image.h:19,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegStream.h:18,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.h:16,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:45:
/usr/include/c++/6/bits/stl_map.h:239:9: note: candidate: template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const allocator_type&)
         map(_InputIterator __first, _InputIterator __last,
         ^~~
/usr/include/c++/6/bits/stl_map.h:239:9: note:   template argument deduction/substitution failed:
/home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:68:92: note:   candidate expects 3 arguments, 6 provided
                                                            {VOCAB_PIXEL_BGR , JCS_EXT_BGR} };
                                                                                            ^
In file included from /usr/include/c++/6/map:61:0,
                 from /home/pi/repos/yarp/src/libYARP_sig/src/yarp/sig/Image.h:19,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegStream.h:18,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.h:16,
                 from /home/pi/repos/yarp/src/carriers/mjpeg_carrier/MjpegCarrier.cpp:45:
/usr/include/c++/6/bits/stl_map.h:233:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const allocator_type&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(initializer_list<value_type> __l, const allocator_type& __a)
       ^~~
/usr/include/c++/6/bits/stl_map.h:233:7: note:   candidate expects 2 arguments, 6 provided
/usr/include/c++/6/bits/stl_map.h:227:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&, const allocator_type&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(map&& __m, const allocator_type& __a)
       ^~~
/usr/include/c++/6/bits/stl_map.h:227:7: note:   candidate expects 2 arguments, 6 provided
/usr/include/c++/6/bits/stl_map.h:223:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&, const allocator_type&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(const map& __m, const allocator_type& __a)
       ^~~
/usr/include/c++/6/bits/stl_map.h:223:7: note:   candidate expects 2 arguments, 6 provided
/usr/include/c++/6/bits/stl_map.h:219:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const allocator_type&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(const allocator_type& __a)
       ^~~
/usr/include/c++/6/bits/stl_map.h:219:7: note:   candidate expects 1 argument, 6 provided
/usr/include/c++/6/bits/stl_map.h:211:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const allocator_type&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(initializer_list<value_type> __l,
       ^~~
/usr/include/c++/6/bits/stl_map.h:211:7: note:   candidate expects 3 arguments, 6 provided
/usr/include/c++/6/bits/stl_map.h:196:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(map&& __x)
       ^~~
/usr/include/c++/6/bits/stl_map.h:196:7: note:   candidate expects 1 argument, 6 provided
/usr/include/c++/6/bits/stl_map.h:185:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(const map& __x)
       ^~~
/usr/include/c++/6/bits/stl_map.h:185:7: note:   candidate expects 1 argument, 6 provided
/usr/include/c++/6/bits/stl_map.h:174:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map(const _Compare&, const allocator_type&) [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >; std::map<_Key, _Tp, _Compare, _Alloc>::allocator_type = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map(const _Compare& __comp,
       ^~~
/usr/include/c++/6/bits/stl_map.h:174:7: note:   candidate expects 2 arguments, 6 provided
/usr/include/c++/6/bits/stl_map.h:162:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::map() [with _Key = int; _Tp = J_COLOR_SPACE; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, J_COLOR_SPACE> >]
       map()
       ^~~
/usr/include/c++/6/bits/stl_map.h:162:7: note:   candidate expects 0 arguments, 6 provided
src/carriers/mjpeg_carrier/CMakeFiles/yarp_mjpeg.dir/build.make:95: recipe for target 'src/carriers/mjpeg_carrier/CMakeFiles/yarp_mjpeg.dir/MjpegCarrier.cpp.o' failed
make[2]: *** [src/carriers/mjpeg_carrier/CMakeFiles/yarp_mjpeg.dir/MjpegCarrier.cpp.o] Error 1
CMakeFiles/Makefile2:5724: recipe for target 'src/carriers/mjpeg_carrier/CMakeFiles/yarp_mjpeg.dir/all' failed
make[1]: *** [src/carriers/mjpeg_carrier/CMakeFiles/yarp_mjpeg.dir/all] Error 2
Makefile:171: recipe for target 'all' failed
make: *** [all] Error 2
PeterBowman commented 4 years ago

Interesting, it probably deserves an upstream issue. Did you manage to compile previous YARP versions on that same HW/SW?

jgvictores commented 4 years ago

AFAIK (or recall), all previous working YARP versions were on Raspian 7, and these are the first attempts with Raspian 9. Nothing serious. It all boils down to:

At least in terms of RD/RD2, I think we're good to go with yarp-3.3.