jesseweisberg / moveo_ros

ROS packages and Arduino scripts that can be used to control the BCN3D Moveo robotic arm in simulation and real-life.
MIT License
297 stars 126 forks source link

moveo_ros

ROS packages that can be used to plan and execute motion trajectories for the BCN3D Moveo robotic arm in simulation and real-life.

Video Demo Here!

How to Use:

Getting the BCN3D Simulation Working with Motion Planning

moveit_screenshot.png

  1. Make sure you have ROS installed correctly with a functioning workspace-- I used ROS Kinetic on Ubuntu 16.04 (if you have a different distro, you may need to change some things). I currently have 'moveo_ros' in the 'src' folder of my catkin workspace.

  2. To plan and execute trajectories for the Moveo in simulation (RVIZ with Moveit plugin), execute the following terminal command:

    roslaunch moveo_moveit_config demo.launch
  3. Once the window loads, in the bottom-left corner check "Allow Approximate IK Solutions." Then click on the "Planning" tab in the MotionPlanning panel of RVIZ. Select a new goal state by either dragging the interactive marker (light blue ball on the end effector) or under "Select Goal State." Once goal state is updated, "Plan and Execute" will plan and execute the trajectory from the start state to the updated goal state.

Moving the real robot, synced with the simulated robot's trajectories.

  1. Make sure you download the AccelStepper (AccelStepper Library Download) and ros_lib (rosserial-arduino tutorial) libraries into your Arduino environment.

    • If ros_lib already exists in your Arduino libraries (/libraries), follow the last troubleshooting tip or you'll get an error saying "ArmJointState.h: no such file". ROS makes you remove ros_lib and regenerate it every time you introduce a new custom message.
  2. Change the pin layout between your robot and the RAMPS 1.4 in 'moveo_moveit_arduino.ino' and upload the file to your Arduino (I'm using MEGA 2560). Make sure the robot and the simulation are in the same position (to set the simulation upright initially-- select "Upright" from "Select Goal States" in RVIZ.

  3. In 'moveit_convert.cpp' replace the stepsPerRevolution array with the steps/revolution (or microsteps/revolution) of each of your motors. (Note: if you don't already know these values, you can experimentally get how many microsteps/revolution your motors have using the MultiStepperTest.ino and recording/eyeballing the results)

  4. With the simulation already running, execute each of the following commands in it's own, separate terminal:

    • rosrun rosserial_python serial_node.py /dev/ttyUSB0(establishes rosserial node that communicates with Arduino)
    • rosrun moveo_moveit moveit_convert (converts simulation joint_state rotations to steps and publishes on the /joint_steps topic, which the Arduino script subscribes to)
    • rostopic pub gripper_angle std_msgs/UInt16 <angle 0-180>(publishes gripper_angle)

Now, whatever trajectories are planned and executed in simulation are echoed on the real robot.

About Directories

moveo_urdf

Contains the URDF (Unified Robot Description File) for the BCN3D Moveo. Necessary for simulation in RVIZ and moveit configuration.

moveo_moveit_config

Configuration for moveit, a motion planning framework that has a plugin in RVIZ, which is what we are using here.

moveo_moveit

Troubleshooting