GEAR Simulation

Table of Contents

Running GEAR Container

  1. On your local system, go to docker_env folder
    • cd /PATH/TO/RRRobot/docker_env
  2. Start GEAR docker container
    • docker-compose run --rm gear

Building & Running Simulation

  1. Source ROS Setup
    • source /opt/ros/melodic/setup.bash
  2. Run Simulation

Controlling Sample Environment

While sample environment is running, open a new terminal (see tips & tricks section of home) on the running docker container. The following sections provide a brief overview of the commands that can be used to control various aspects of the simulation. For a full list, check out the ARIAC 2019 Wiki.

sample_run.sh moves arm 1 over the gasket part, picks it up, moves it to AGV1’s tray, drops it, and moves back to the starting position.

Start Competition

rosservice call /ariac/start_competition

Controlling Arms

Gripper

Joints

Move arm1 over a gasket part

rostopic pub /ariac/arm1/arm/command trajectory_msgs/JointTrajectory    "{joint_names: \
        ['linear_arm_actuator_joint',  'shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'], \
     points: [ \
{time_from_start: {secs: 2}, \
        positions: [0.15, 3.14,  -1.570,  2.14, 3.1, -1.59, 0.126]}, \
{time_from_start: {secs: 4}, \
        positions: [-0.35, 3.14,  -0.6,  2.3, 3.0, -1.59, 0.126]}, \
{time_from_start: {secs: 6}, \
        positions: [-0.35, 3.14,  -0.5,  2.3, 3.05, -1.59, 0.126]}, \
]}" -1

Move part to AGV1’s tray

rostopic pub /ariac/arm1/arm/command trajectory_msgs/JointTrajectory    "{joint_names: \
        ['linear_arm_actuator_joint',  'shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'], \
     points: [ \
{time_from_start: {secs: 2}, \
        positions: [0.0, 3.14,  -1.570,  2.14, 3.27, -1.51, 0.0]}, \
{time_from_start: {secs: 5}, \
        positions: [1.0, 1.85,  0,  -0.38, 1.57, -1.51, 0.00]}, \
{time_from_start: {secs: 7}, \
        positions: [1.0, 1.507,  0,  -0.38, 0.38, -1.51, 0.00]}, \
{time_from_start: {secs: 10}, \
        positions: [1.18, 1.507,  0.38,  -0.38, 1.55, 1.75, 0.127]}, \
]}" -1

Return to starting position

rostopic pub /ariac/arm1/arm/command trajectory_msgs/JointTrajectory    "{joint_names: \
        ['linear_arm_actuator_joint',  'shoulder_pan_joint', 'shoulder_lift_joint', 'elbow_joint', 'wrist_1_joint', 'wrist_2_joint', 'wrist_3_joint'], \
     points: [ \
{time_from_start: {secs: 5}, \
        positions: [0.0, 3.14,  -1.570,  2.14, 3.27, -1.51, 0.0]}, \
]}" -1

Running Full Simulation

Manual Process for Testing

Terminal 1: ARIAC Environment

Terminal 2: Build RRRobot Package & Arm Controller Node

Terminal 3: CV Model

Terminal 4: Depth Camera Node (for getting pick up location)

Terminal 5: Run the main rrrobot node

Terminal 6: Run the node to spawn random objects onto the conveyor belt

Semi-Automated Process

Terminal 1

In terminal 1, run the script that will build all components and run the nodes. You may need to adjust the sleep times in run_all.sh based on your system’s performance such that there is enough time for each component to finish before proceeding.

Terminal 2

When a new item is spawned after the arm drops off the previous item, the conveyor belt must be manually started again using rosservice call /ariac/conveyor/control "power: 100" so that the item moves to the depth camera and the process can continue. You can do this in a new terminal since terminal 1 is running all of the simulation nodes.

Troubleshooting

If you encounter issues with newline characters when attempting to run scripts, use the dos2unix tool to convert them to linux style newline characters. These errors usually look like /bin/bash^M: bad interpreter: No such file or directory or env: python\r: No such file or directory.