下载: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.

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