下載:ros-nasa-r2源碼過程

  1. 1、清除本地已有的git參數

先查看是否存在

$ git config --global user.name "你的名字"
$ git config --global user.email  "你的郵箱"

如果存在,必須刪除

$ git config --global --unset user.name "你的名字"
$ git config --global --unset user.email "你的郵箱"
  1. 2、生成ssh祕鑰對,後續要配置
ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "p**[email protected]"

 之後會在用戶目錄生成兩個文件: ~/.ssh/id_rsa.gitlab, ~/.ssh/id_rsa.gitlab.pub(公鑰)

  1. 3、識別新SSH祕鑰
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa.gitlab
  1. 4、配置config文件,支持多個git賬號(gitee/github/gitlab)
$ gedit ~/.ssh/config

// 如果文件不存在創建即可,內容如下:
#Add gitLab user 
    Host [email protected]
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/id_rsa.gitlab
  1. 5、gitlab網站配置ssh-key

user-setting -> ssh-key --> add-key,把 id_rsa.gitlab.pub文件中內容粘貼進來,完全粘貼,保存即可。

ssh -T [email protected],可以測試是否成功

  1. 6、下載源碼

git clone [email protected]:nasa-jsc-robotics/r2_workspaces.git/

  1. 7、剩餘參考r2官網說明操作
  2. https://gitlab.com/nasa-jsc-robotics/robonaut2/wikis/R2%20Gazebo%20Simulation

Workspace

The R2 simulation software checkout is configured to work with SSH keys. Set those up for GitLab

Now build the simulator workspace. Run the following:

mkdir -p ~/git
cd ~/git
git clone [email protected]:nasa-jsc-robotics/r2_workspaces.git
cd r2_workspaces
git checkout develop
mkdir -p ~/r2_sim/src
cd ~/r2_sim/src
catkin_init_workspace
vcs import < ~/git/r2_workspaces/sim_external_http.yaml
vcs custom --args checkout develop
cd ..
rosdep install -y -i --from-paths src
catkin_make

Note: robot_instance has a known dependency issue on develop. Please run the following to fix:

cd ~/r2_sim/src/robot_instance
git checkout 2016_11_7_ar_demo

R2 Simulation Environment

Create a file named ~/.r2_sim with the following contents:

#!/bin/bash 
source ~/.ros_clean
source /opt/ros/indigo/setup.sh

if [ -f ~/r2_sim/devel/setup.sh ]
then
    source ~/r2_sim/devel/setup.sh
else
    if [ -d ~/r2_sim/src ]
    then
        export ROS_PACKAGE_PATH=~/r2_sim/src:$ROS_PACKAGE_PATH
    fi
fi

And run the following each time you want to use the simulation:

source ~/.r2_sim

Optionally, you can automatically configure the simulation environment every time you open a terminal by running the following:

echo "source ~/.r2_sim" >> ~/.bashrc

R2 Simulation Execution

There exist many different ways to launch and use the R2 Simulation. Here's one example:

roslaunch r2_gazebo r2c_upperbody.launch ros_control:=true robodyn:=true
rosrun r2_supervisors_control r2_ready_pose.py
rosrun r2_supervisors_control r2_test.py

Additionally, systems like MoveIt! can be used to make R2 perform actions.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章