IE-482-582 / fall2020

Course materials for the Fall 2020 semester of IE 482/582
5 stars 9 forks source link

chessbot #22

Open cmurray3 opened 4 years ago

cmurray3 commented 4 years ago

Download chessbot.zip from https://buffalo.box.com/s/0526ny2dh2569si396a50enfo6k3ay5f

cmurray3 commented 4 years ago
# Remove old key:
sudo apt-key del B01FA116

# Get new key:
sudo -E apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

# Final cleanup:
sudo apt-get clean && sudo apt update

# Install ROS packages
cd ~

sudo apt-get install ros-indigo-ros-control ros-indigo-gazebo-ros-control ros-indigo-joint-state-controller ros-indigo-effort-controllers ros-indigo-joint-trajectory-controller ros-indigo-moveit* ros-indigo-octomap* ros-indigo-object-recognition*

mkdir -p ~/Projects/
cmurray3 commented 4 years ago
cmurray3 commented 4 years ago

[Terminal 1] Start the R2 in Gazebo:

cd ~/Projects/chessbot
source devel/setup.bash
roslaunch r2_gazebo r2_gazebo.launch
cmurray3 commented 4 years ago

[Terminal 2] Compute Forward Kinematics:

rosrun robot_state_publisher robot_state_publisher
cmurray3 commented 4 years ago

[Terminal 3] Start Moveit:

cd ~/Projects/chessbot
source devel/setup.bash
roslaunch r2_moveit_config move_group.launch
cmurray3 commented 4 years ago

[Terminal 4] Run the Mime:

source ~/Projects/chessbot/devel/setup.bash
cmurray3 commented 4 years ago

Moving R2's HAND:

MOVING R2's HAND

1) [Terminal 4] Move the hand to a location on the chessboard:

cd ~/Projects/chessbot/src/scripts
chmod +x r2_chessboard_cli.py
./r2_chessboard_cli.py a2 0.04

2) [Terminal 4] Hand pinch:

cd ~/Projects/chessbot/scripts
chmod +x r2_hand.py
./r2_hand.py pre-pinch
./r2_hand.py pinch
cmurray3 commented 4 years ago

PLAYING CHESS

1) [Terminal 1] Start the R2 in Gazebo:

cd ~/Projects/chessbot
source devel/setup.bash
roslaunch r2_gazebo r2_gazebo.launch

2) [Terminal 2] Compute Forward Kinematics:

rosrun robot_state_publisher robot_state_publisher

3) [Terminal 3] Start Moveit:

cd ~/Projects/chessbot
source devel/setup.bash
roslaunch r2_moveit_config move_group.launch

4) [Terminal 4] Spawn (and reset) the chessboard:

cd ~/Projects/chessbot/src/scripts
source ~/Projects/chessbot/devel/setup.bash
chmod +x spawn_chessboard.py
./spawn_chessboard.py

5) [Terminal 5] Playback a chess match:

cd ~/Projects/chessbot/src/scripts
chmod +x r2_chess_pgn.py

source ~/Projects/chessbot/devel/setup.bash
./r2_chess_pgn.py morgan_defeated.pgn
./r2_chess_pgn.py morgan_defeated_lan.pgn