tmigimatsu / logic-opt

Object-Centric TAMP in Dynamic Environments
MIT License
29 stars 2 forks source link

Segmentation fault at ./franka_panda_opspace #2

Open yanghaoxiang7 opened 3 years ago

yanghaoxiang7 commented 3 years ago

@tmigimatsu I met this error when executing "./franka_panda_opspace":

Usage:
        ./franka_panda_opspace <franka_panda.urdf> [--friction]

Loading urdf: ../resources/franka_panda/franka_panda.urdf
Segmentation fault (core dumped)

And also another two problems when I tried to reproduce the results, which may give you some extra information:

  1. after executing "./franka_panda_opspace", I cannot perturb the robot arm with "ctrl-clicking".
  2. when I try to execute "./lgp" and "./traj", the robot arm doesn't move at all and there. I guess these two are also due to the failure of operating robot arms. Is there anything I can do to fix these problem? thks

(however, after executing "./lgp ../resources/reach_config.yaml" I can perturb the object with "ctrl-clicking")

yanghaoxiang7 commented 3 years ago

additional information: segmentation fault happens at line 456 in src/opspace/src/main.cc:

pose_des = std::pair<Eigen::Vector3d, Eigen::Quaterniond>{ x_des, quat_des };

yanghaoxiang7 commented 3 years ago

The problem is fixed by using gcc version 7! Here's my reproducing record from a clean ubuntu 16.04. (These process are also tested on ubuntu 20.04.)

[a clean ubuntu 16.04 system is installed on VMWare]
# vmware settings
sudo apt-get update
sudo apt-get install open-vm-tools-desktop -y
sudo reboot

[change to tsinghua mirror, otherwise ubuntu installation will be too slow because of China's wall]
sudo apt-get install vim -y
sudo cp /etc/apt/sources.list /etc/apt/sources_copy.list
sudo vim /etc/apt/sources.list
# type in utsc mirror https://mirrors.ustc.edu.cn/repogen/
sudo apt-get update
sudo apt-get upgrade -y

[install gcc-7 g++-7]
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7 g++-7 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
sudo update-alternatives --config gcc
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100
sudo update-alternatives --config g++
# gcc --version
# g++ --version

[install other prerequisites]
sudo apt-get install python3 cmake git -y

[install Ipopt]
cd ~
git clone --recursive https://github.com/tmigimatsu/logic-opt.git
sudo apt install pkg-config gfortran automake liblapack-dev libmetis-dev -y
cd logic-opt
# open ./install_ipopt.sh in editer and comment the line #27: "mv coinhsl-* coinhsl"
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
./install_ipopt.sh

[rustup]
sudo apt install python3-dev curl redis-server
# direct rustup installation is too slow in China because of its wall
# instead I am using tsinghua mirror to install rustup
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# click "1"
cd ~
vim .bashrc
# add "source $HOME/.cargo/env" to .bashrc
source .bashrc

[update higher version cmake]
cd ~
sudo apt-get autoremove cmake
sudo apt-get install build-essential
wget http://www.cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar xf cmake-3.12.3.tar.gz
cd cmake-3.12.3
./configure
make -j4
sudo make install
# cmake --version

[logic-opt]
cd ~/logic-opt
mkdir build
cd build
cmake ..
make -j4

[meet an error: ‘RegisterObject’ is not a member of ‘redis_gl::simulator’]
# This is a bug I found and fixed. I have posted this issue on github.
# My fix to this problem is:
-----
add:
#include <redis_gl/robot.h>
to:
(1) ~/logic-opt/src/opspace/src/main.cc (after line 33's #include <redis_gl/redis_gl.h>)
(2) ~/logic-opt/src/control/opspace_controller.cc (after line 24's #include <redis_gl/redis_gl.h>)
and recompile using:
cd ~/logic-opt/build
cmake ..
make -j4
-----
When meet this error:
make[2]: *** No rule to make target 'ncollide_cpp/build/libncollide_cpp.so', needed by '../bin/traj'.  Stop.
When this type of errors occur, re-run installations for intact.

[install anaconda]
./Anaconda3-2021.05-Linux-x86_64.sh
python --version # 3.8.8
pip --version # 21.0.1

[redis: run these in window #1]
cd ~
git clone https://github.com/tmigimatsu/redis-gl.git
cd redis-gl
pip install pipenv
pipenv --three
pipenv install
redis-server
[server is open; can be closed at anytime and will run in background]

[open a new window #2]
cd ~/redis-gl/
pipenv run ./server.py
open 127.0.0.1:8000

[open a new window #3]
cd ~/logic-opt/bin
./franka_panda_opspace
refresh 127.0.0.1:8000

[open a new window #4]
cd ~/logic-opt/bin
./lgp ../resources/reach_config.yaml
./lgp ../resources/hanoi_config.yaml
limit1998 commented 3 years ago

hey bro! Can you leave me a coinhsl.tgz?My email is :limi@emails.bjut.edu.cn

I just want to reproduce quickly!

thank you very much!

ChaofanTao commented 1 year ago

./lgp ../resources/hanoi_config.yaml

Hi, I am following your instructions and doing a reproduction. I get no error returned, however, the simulator visualizes no objects but a 3D coordinate.

  1. By running ./franka_panda_opspace, the terminal returns Loading urdf: ../resources/franka_panda/franka_panda.urdf without reporting segmentation fault.
  2. Then, I run the ./lgp ../resources/reach_config.yaml or ./lgp ../resources/hanoi_config.yaml, the terminal returns a series of planning like:
    
    Opening gripper... Done.
    Closing gripper to 81... 
    Done.
    Opening gripper... Done.
    Closing gripper to 108... 
    Done.
    Opening gripper... Done.
    Closing gripper to 55... 
    Done.
    Opening gripper... Done.
    Closing gripper to 108... 
    Done.
    Opening gripper... Done.
    Closing gripper to 81... 
    Done.
    Opening gripper... Done.
    Closing gripper to 108... 
    Done.
    Opening gripper... Done.
    Simulated 19.025s in 19.0243s.

RedisPublishTrajectories(): AtomicQueue::Pop(): Queue marked as finished. Exiting Redis thread.```

However, no objects are visualized on my simulator. Do u remember what is presented on the simulator?

liushuown commented 1 month ago

The problem is fixed by using gcc version 7! Here's my reproducing record from a clean ubuntu 16.04. (These process are also tested on ubuntu 20.04.)

[a clean ubuntu 16.04 system is installed on VMWare]
# vmware settings
sudo apt-get update
sudo apt-get install open-vm-tools-desktop -y
sudo reboot

[change to tsinghua mirror, otherwise ubuntu installation will be too slow because of China's wall]
sudo apt-get install vim -y
sudo cp /etc/apt/sources.list /etc/apt/sources_copy.list
sudo vim /etc/apt/sources.list
# type in utsc mirror https://mirrors.ustc.edu.cn/repogen/
sudo apt-get update
sudo apt-get upgrade -y

[install gcc-7 g++-7]
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7 g++-7 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
sudo update-alternatives --config gcc
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100
sudo update-alternatives --config g++
# gcc --version
# g++ --version

[install other prerequisites]
sudo apt-get install python3 cmake git -y

[install Ipopt]
cd ~
git clone --recursive https://github.com/tmigimatsu/logic-opt.git
sudo apt install pkg-config gfortran automake liblapack-dev libmetis-dev -y
cd logic-opt
# open ./install_ipopt.sh in editer and comment the line #27: "mv coinhsl-* coinhsl"
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
./install_ipopt.sh

[rustup]
sudo apt install python3-dev curl redis-server
# direct rustup installation is too slow in China because of its wall
# instead I am using tsinghua mirror to install rustup
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# click "1"
cd ~
vim .bashrc
# add "source $HOME/.cargo/env" to .bashrc
source .bashrc

[update higher version cmake]
cd ~
sudo apt-get autoremove cmake
sudo apt-get install build-essential
wget http://www.cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar xf cmake-3.12.3.tar.gz
cd cmake-3.12.3
./configure
make -j4
sudo make install
# cmake --version

[logic-opt]
cd ~/logic-opt
mkdir build
cd build
cmake ..
make -j4

[meet an error: ‘RegisterObject’ is not a member of ‘redis_gl::simulator’]
# This is a bug I found and fixed. I have posted this issue on github.
# My fix to this problem is:
-----
add:
#include <redis_gl/robot.h>
to:
(1) ~/logic-opt/src/opspace/src/main.cc (after line 33's #include <redis_gl/redis_gl.h>)
(2) ~/logic-opt/src/control/opspace_controller.cc (after line 24's #include <redis_gl/redis_gl.h>)
and recompile using:
cd ~/logic-opt/build
cmake ..
make -j4
-----
When meet this error:
make[2]: *** No rule to make target 'ncollide_cpp/build/libncollide_cpp.so', needed by '../bin/traj'.  Stop.
When this type of errors occur, re-run installations for intact.

[install anaconda]
./Anaconda3-2021.05-Linux-x86_64.sh
python --version # 3.8.8
pip --version # 21.0.1

[redis: run these in window #1]
cd ~
git clone https://github.com/tmigimatsu/redis-gl.git
cd redis-gl
pip install pipenv
pipenv --three
pipenv install
redis-server
[server is open; can be closed at anytime and will run in background]

[open a new window #2]
cd ~/redis-gl/
pipenv run ./server.py
open 127.0.0.1:8000

[open a new window #3]
cd ~/logic-opt/bin
./franka_panda_opspace
refresh 127.0.0.1:8000

[open a new window #4]
cd ~/logic-opt/bin
./lgp ../resources/reach_config.yaml
./lgp ../resources/hanoi_config.yaml

Hi,even though I #include <redis_gl/robot.h> in two files, and recmake .., I'm still having this problem, can you help me out? My error is

home/liushuo/logic-opt/src/control/opspace_controller.cc:223:26: error: ‘ObjectModel’ is not a member of ‘redis_gl::simulator’ 223 | redis_gl::simulator::ObjectModel object_model; | ^~~ /home/liushuo/logic-opt/src/control/opspace_controller.cc:225:5: error: ‘object_model’ was not declared in this scope 225 | object_model.name = frame; | ^~~~ /home/liushuo/logic-opt/src/control/opspace_controller.cc:229:26: error: ‘RegisterObject’ is not a member of ‘redis_gl::simulator’ 229 | redis_gl::simulator::RegisterObject(redis, kModelKeys, object_model); | ^~~~~~ /home/liushuo/logic-opt/src/control/opspace_controller.cc:247:26: error: ‘RegisterRobot’ is not a member of ‘redis_gl::simulator’ 247 | redis_gl::simulator::RegisterRobot(redis, kModelKeys, gripper, KEY_ROBOTIQ_Q, KEY_SENSOR_POS, KEY_SENSOR_ORI);