Skip to content
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

RD2 revival #1

Open
2 of 4 tasks
jgvictores opened this issue Jun 22, 2018 · 26 comments
Open
2 of 4 tasks

RD2 revival #1

jgvictores opened this issue Jun 22, 2018 · 26 comments
Assignees

Comments

@jgvictores
Copy link
Member

jgvictores commented Jun 22, 2018

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
Copy link
Member Author

jgvictores commented Jun 22, 2018

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

@jgvictores
Copy link
Member Author

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

@PeterBowman
Copy link
Member

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
Copy link
Member Author

From asrob-uc3m/robotDevastation-robots#44 I see that for RD Ambassador at asrob-uc3m/rd-ambassador#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
Copy link
Member

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 asrob-uc3m/yarp-devices@9f777d1 (CMake bumped from 2.8.9 to 3+) and cherry pick asrob-uc3m/yarp-devices@341a73c.

@PeterBowman
Copy link
Member

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
Copy link
Member Author

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 PeterBowman self-assigned this Nov 7, 2018
@PeterBowman
Copy link
Member

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 asrob-uc3m/yarp-devices@7db08bd. However, #2 and #3 are now blocking further progress.

@PeterBowman
Copy link
Member

PeterBowman commented Nov 24, 2018

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 asrob-uc3m/robotDevastation-developer-manual#12.

PS see asrob-uc3m/robotDevastation-developer-manual#12 (comment).

@jgvictores
Copy link
Member Author

jgvictores commented Apr 3, 2019

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
Copy link
Member

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

@jgvictores
Copy link
Member Author

Updated description on Prototype status: in robotera.

  • Raspi 1 screwed to chassis
  • Uses large SD card, has 8GB SDHC (large), seems functional but has Raspian 7 (not 9)
  • Other issues are regarding number of USBs (only 2, used by camera and wifi) and not accesible without unscrewing

@jgvictores
Copy link
Member Author

  • 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
Copy link
Member Author

jgvictores commented Apr 3, 2019

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:

  • rp1
  • rp2 - plastic
  • rp3 - plastic
  • rp4 - plastic
  • rp5 (GND) - GND
  • rp6 (GPIO 17) - servo
  • rp7 (GPIO 27) - servo

photo_2019-04-03_17-49-22

@jgvictores
Copy link
Member Author

jgvictores commented Jun 4, 2019

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 asrob-uc3m/robotDevastation-developer-manual#13) where documentation is being migrated to https://github.com/asrob-uc3m/robotDevastation-developer-manual/tree/master/robots (perma).

@jgvictores
Copy link
Member Author

Replicated steps with big Toshiba 16 GB SD (fsarchiver and fdisk as explained staring at asrob-uc3m/rd-ambassador#1 (comment)) and got booting Raspian 9. 🎉

photo_2019-06-25_21-03-53

@jgvictores
Copy link
Member Author

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

  • Keyboard: Managed this via a wireless dongle, Logitech does some magic so no pairing is required (once pairing has been done previously on another machine).
  • Wifi dongle: Not configured to connect to any network, but at least wlan0 interface is up!

@jgvictores
Copy link
Member Author

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
Copy link
Member Author

jgvictores commented May 17, 2020

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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

[100%] Built target RobotServer

real    9m45.548s
user    8m42.032s
sys     0m43.627s

@jgvictores
Copy link
Member Author

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 #1 (comment)).

@jgvictores
Copy link
Member Author

Compiling on Raspi 3 B+ but same setup as #1 (comment); 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
Copy link
Member

PeterBowman commented Aug 3, 2020

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

@jgvictores
Copy link
Member Author

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:

  • The yarpdatadumper issue described above. We do not need this (for what it's worth, or any other GUI) on Raspi. In fact, the OS is headless and I installed a whole bunch of deps just to compile the GUIs. I'd leave it as a won't-fix/low-priority, if we ever run into it again, here it is.
  • The MJPEG carrier issue I just solved via sudo apt install libjpeg62-turbo-dev (previously removing other failed versions: both libjpeg8-dev and libjpeg9-dev)! (thanks: Larry the Git Cow "Depend on 'media-libs/libjpeg-turbo' instead of 'virtual/jpeg', since 'media-libs/jpeg' causes issues such as build failures. Also remove the use of the patch specific to jpeg-9, which is no longer needed after this change." at https://bugs.gentoo.org/648200)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants