先查看是否存在
$ git config --global user.name "你的名字"
$ git config --global user.email "你的邮箱"
如果存在,必须删除
$ git config --global --unset user.name "你的名字"
$ git config --global --unset user.email "你的邮箱"
ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "p**y@163.com"
之后会在用户目录生成两个文件: ~/.ssh/id_rsa.gitlab,
~/.ssh/id_rsa.gitlab.pub(公钥)
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa.gitlab
$ gedit ~/.ssh/config
// 如果文件不存在创建即可,内容如下:
#Add gitLab user
Host git@gitlab.com
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_rsa.gitlab
user-setting -> ssh-key --> add-key,把 id_rsa.gitlab.pub文件中内容粘贴进来,完全粘贴,保存即可。
ssh -T git@gitlab.com,可以测试是否成功
git clone git@gitlab.com:nasa-jsc-robotics/r2_workspaces.git
/
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 git@gitlab.com: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
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
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.