事件相机模拟器rpg-esim环境搭建

事件相机模拟器rpg-esim环境搭建

project page: http://rpg.ifi.uzh.ch/esim.html
PDF: http://rpg.ifi.uzh.ch/docs/CORL18_Rebecq.pdf
github地址: https://github.com/uzh-rpg/rpg_esim
安装地址: https://github.com/uzh-rpg/rpg_esim/wiki/Installation
Ros官网: http://wiki.ros.org
要使用rpg-esim,需要安装Ros,kinetic是官方推荐的,但是用melodic也可以。
Ros说明,Ros是机器人操作系统,目前主要安装Linux的Ubuntu系统下,其对于不同版本的Ubuntu也有不同的版本,kinetic对应16.04,melodic对应18.04,Neotic对应20.04。
所以目前建议在16.04和18.04的Ubuntu设备上进行安装和使用。
因为我用的Ubuntu18.04,因此下面记录Ubuntu18.04下的环境搭建。

  1. 安装Ros Melodic http://wiki.ros.org/melodic/Installation/Ubuntu ,我也就是按照这个里面的步骤走完的,没有什么特别的地方。

    1. 在Ubuntu软件和更新里面把仓库设置为允许"restricted," “universe,” and “multiverse.” ,一般默认就是如此设置的
    2. 设置源列表: sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    3. 设置apt秘钥: sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
    4. 更新apt: sudo apt update安装桌面完整版: sudo apt install ros-melodic-desktop-full
    5. 环境配置:
    echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
    source ~/.bashrc
    
    1. 安装需要的包:
    sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
    sudo apt install python-rosdep
    sudo rosdep init  #如果这里失败了,说网站可能关闭了,参照这里解决:https://www.guyuehome.com/12640
        # 我使用的是方案二,sudo gedit /etc/hosts
        然后添加下面两行:
        199.232.28.133 raw.githubusercontent.com
        151.101.228.133 raw.github.com
    rosdep update
    
  2. 安装一些必要的包

    pip install opencv-python opencv-contrib-python numpy rospkg pyyaml
    sudo apt-get install python-catkin-tools
    
  3. 设定自己的github publickey https://blog.csdn.net/Awesomewan/article/details/110206402

    ssh-keygen -t rsa -C "1345615947@qq.com"
    直接回车采用默认位置,然后设置一个密码,我设的123456
    ssh-agent -s
    ssh-add ~/.ssh/id_rsa #如果开了新的窗口或重启了电脑都应该先执行这一步,给ssh提供私钥。否则会一直弹窗口让输入前面账号的密码。
    再输一次刚才设置的密码
    打开你生成的id_rsa.pub
    cat ~/.ssh/id_rsa.pub
    将里面的内容()粘贴到你的github帐号中:settings->SSH and GPG keys->new SSH key
    验证: ssh -T git@github.com  如果输出: Hi itsalpha! You’ve successfully authenticated, but GitHub does not provide shell access. 为正确
    
  4. 安装 rpg-esim https://github.com/uzh-rpg/rpg_esim/wiki/Installation
    1.

    mkdir -p ~/sim_ws/src && cd ~/sim_ws
    catkin init
    catkin config --extend /opt/ros/melodic --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wno-int-in-bool-context
    sudo apt-get install python-vcstool
    cd src/
    git clone git@github.com:uzh-rpg/rpg_esim.git
    vcs-import < rpg_esim/dependencies.yaml
    sudo apt-get install ros-melodic-pcl-ros
    sudo apt-get install libglfw3 libglfw3-dev libglm-dev
    cd ze_oss
    touch imp_3rdparty_cuda_toolkit/CATKIN_IGNORE \
        imp_app_pangolin_example/CATKIN_IGNORE \
        imp_benchmark_aligned_allocator/CATKIN_IGNORE \
        imp_bridge_pangolin/CATKIN_IGNORE \
        imp_cu_core/CATKIN_IGNORE \
        imp_cu_correspondence/CATKIN_IGNORE \
        imp_cu_imgproc/CATKIN_IGNORE \
        imp_ros_rof_denoising/CATKIN_IGNORE \
        imp_tools_cmd/CATKIN_IGNORE \
        ze_data_provider/CATKIN_IGNORE \
        ze_geometry/CATKIN_IGNORE \
        ze_imu/CATKIN_IGNORE \
        ze_trajectory_analysis/CATKIN_IGNORE
    如果实在conda环境下,需要执行下面的操作,否则会有组件安装失败:
        conda install setuptools
        pip install -U rosdep rosinstall_generator wstool rosinstall six vcstools
    catkin build esim_ros
    echo "source ~/sim_ws/devel/setup.bash" >> ~/setupeventsim.sh
    chmod +x ~/setupeventsim.sh
    alias ssim='source ~/setupeventsim.sh'
    

    注意:每次使用的时候(新开terminal窗口)先使用ssim命令,把工作空间激活。

  5. 测试事件相机模拟器 https://github.com/uzh-rpg/rpg_esim/wiki/Planar-Renderer

    $ ssim
    $ roscd esim_ros  
    $ gedit cfg/example.conf #里面有个绝对路径,把里面的user改成你的用户名,我的是改成了iccd
    #新开一个terminal,以打开可视化窗口
    $ ssim
    $ roscd esim_visualization
    $ rviz -d cfg/esim.rviz
    #回到刚才的terminal窗口
    $ roslaunch esim_ros esim.launch config:=cfg/example.conf
    #这个时候就能够看到可视化窗口里面在模拟事件相机的数据了。
    # 如果想看更详细的信息,新开一个terminal窗口,用rqt进行查看
    $ ssim
    $ roscd esim_visualization
    $ rqt --perspective-file cfg/esim.perspective
    
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值