kkimurak / ssl-setup Goto Github PK
View Code? Open in Web Editor NEWBash script that setup the official RoboCup-SSL tools with required packages ( https://github.com/RoboCup-SSL/ )
Bash script that setup the official RoboCup-SSL tools with required packages ( https://github.com/RoboCup-SSL/ )
This script installs all of required packages for official tools and useful tools for beginner even if user does not want them.
I want to change the behavior with command line option.
e.g. -b
It mean "Build" , so when run the script with this option,
only the function "build_ssl_tools()" will be called.
Additionally, options that runs each functions will be required I think.
Currently I'm using "sudo" for each commands.
But in this method, password required many times (because it takes few minutes to process).
Idea :
delete all sudo
, run this script as root isntead.
This will place robocup-ssl's tools for /root/Documents
, it's problem.
So, I can use su -l ${logname}
when required.
Currently I'm setting the flag set -Ceu
.
I think option -e
will check the exit code for each line,
and I added || echo "error message for line"
for end of most of lines.
It will returns non-error value, so option -e
may not work.
BTW, I've added function error_end()
to script. it shows error message and exit with 1. I can use this.
grSim already supports inline build when vartypes not found.
ssl-vision also contains vartypes in its source (src/share) and uses this.
So we don't need to build and install vartypes library by ourselves.
ssl-rules-jp is ready, so now I can replace the web page that be shown after installation.
Using Arch Linux, installDeps.sh only installs dependency for ER-Force, and the script I made stops when building TIGERs's AutoReferee, reporting no javac found.
Currently I'm running installDeps.sh via
yes | curl https://raw.githubusercontent.com/robocup-ssl/ssl-autorefs/master/installDeps.sh | bash`.
I think it is better to fix it like this :
curl https://raw.githubusercontent.com/robocup-ssl/ssl-autorefs/master/installDeps.sh > installDeps.sh
yes | bash installDeps.sh
I'm waiting for the pull request 5 will be merged...
I recommend to use xdg-open
instead.
overview
In the end of script, there's a change to open some web page automatically using xdg-open
.
Currently this command is run as root, so it will return error message like this :
Running Firefox as root in a regular user's session is not supported.
Solution
use same method to build ssl-tools
Currently this script will install ode 0.13 (if need to build from source),
and OpenCV is also older version.
Need a way to get latest release, and I've already did it for ssl-game-controller.
OpenCV is hosted on GitHub. How about ODE...?
I need to know how to get latest release on BitBucket.
This script is only tested on Fedora and Ubuntu.
In my team it is recommended to use Fedora or Arch Linux to develop our AI system for RoboCup-SSL.
So I think I have to test this on Arch Linux.
idea
-R (source directory) -D (output directory)
Same as kkimurak/get-latest-ssl-tools#10
Error reported during running robocup-ssl/ssl-autorefs/installDeps.sh on Fedora 34 (Linux fedora 5.12.12-300.fc34.x86_64).
The package qt5-devel
have been removed and qt5-qtbase-devel
may be a replacement.
during test of script, I've build and installed vartypes so many times. It's too noisy.
So check if vartypes is already installed before install_vartypes().
Example :
if ! ls /usr/local/lib/*vartypes* > /dev/null; then
install_vartypes
fi
In current script, for Ubuntu, there're process to add ppa boost repository.
I don't remember why I did so because it was a long time ago that I had tested on Ubuntu before.
(I may have read the page that wrote it)
Due to this INVALID repository, apt is not working correctly during installation process of Dependency for ssl-autorefs,
so build for ssl-autorefs fail.
In Ubuntu 18.04 LTS, libboost is in official repository.
So I don't need to add ppa repository for boost.
idea : use figlet
When using xfce, ~/Desktop is the only directory that created in default.
And, in function install_liraries(), creating directory ~/Documents/sslinst_tmp
- and this function is run as root.
So it will cause permission problem.
It is better to use temporal directory
idea : use mktemp
# current code
local path_tmp=/home/${SUDO_USER}/Documents/sslinst_tmp/
mkdir -p path_tmp && cd $_
# using mktemp : no need to mkdir, mktemp make directory and return its path
local path_tmp="$(mktemp)/sslinst_tmp/"
see #27 (comment)
Currently the libraries to be installed are written in plain text.
e.g. dnf -y install git boost-devel ...
That's weird and I want to divide them.
#6 will decrease them, but that's not enough because most of them does not support fedora...
we can use variables in bash. so those libraries could be put together like this :
dnf_grsim="git automake gcc gcc-c++ kernel-devel qt-devel mesa-libGL-devel mesa-libgGLU-mesa-devel protobuf-compiler ode ode-devel"
apt_grsim= "..."
dnf_vision="gcc libjpeg libpng v4l-utils libdc1394 libdc1394-devel"
...
dnf install ${dnf_grsim} ${dnf_vision}
I've tested on Fedora32 but build for grSim failed. It stopped with reporting error about FindODE
even pkg-config
is already installed.
Then I checked var, it was empty
$ echo $PKG_CONFIG_PATH
# nothing shown
ok, PKG_CONFIG_PATH is not set.
I've tested with this and build passed successfully.
If I can't find out any solution, I'll put this in script.
$ pwd
~/Documents/robocup/tools/grSim/build
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cmake ..
I'm currently using read
with option -t
to set the path to place ssl-tools,
but read -t
will make the script finish when nothing typed.
In my idea, It must jump to the * )
case if there is no input.
To check exit status code will help us to solve this problem.
Current code :
read -r -t 60 SSL_DIR
# process finish before reaching to `case`
case $SSL_DIR in
# each process
Example code to check the exit status :
read -r -t 60 SSL_DIR || if [ "$?" == "142" ] ; then echo " set to default..."; fi
case $SSL_DIR in
# each process
It worked fine.
read -t N
always returns it (of course N is not 0).Recently grSim officially add support for qt5, so old version of qt may not works.
I have to update installation section after work #11
vartypes is originally hosted in szi's repository and still available.
But recently grsim changed the reference to vartypes here (you can see the detail of commit in grSim here )
I must update link for it.
I'm not using Ubuntu usually so I'm not sure,
but it is recommended by developer.
Some of the tools have their own script to install dependent libraries.
I think it is better to use them.
see ssl-vision pull 168
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.