GithubHelp home page GithubHelp logo

mo7ammed-saleh / robot_arm_control_in_ros Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 6.24 MB

Control 5 DoF Robotic Arm using ROS platform with Gazebo, Rviz and Moveit Simulation environments.

ros robotics gazebo urdf rviz

robot_arm_control_in_ros's Introduction

Robot Arm Control Using ROS

This Repository will explain my first task in Robotics and AI department at SMART METHODS summer training.

Task Requirements:

  • Control a robot arm actuator using Robot Operating System (ROS) platform with Rviz, Gazebo and Moveit Simulator.

Detailed Steps:

  1. Install Ubuntu to work with ROS platform. I will use Ubuntu-18.04 (You can install Ubuntu with Windows in a virtual machine like Virtual box or Vmware).

  2. Instal ROS Melodic using the commands bellow in the terminal (Melodic is the version of ROS that correspond with Ubuntu-18.04).

    • sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
    • sudo apt install curl
    • curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
    • sudo apt-get update
    • sudo apt install ros-melodic-desktop-full
    • apt search ros-melodic
    • echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
    • source ~/.bashrc
    • sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
    • sudo apt install python-rosdep
    • sudo rosdep init
    • rosdep update
  3. Install a Catkin Workspace which is a folder to combine all packages for ROS.

    • sudo apt-get install ros-melodic-catkin
    • mkdir -p ~/catkin_ws/src
    • cd ~/catkin_ws/
    • catkin_make
    • cd ~/catkin_ws/src
    • git clone https://github.com/smart-methods/arduino_robot_arm.git we will use the arm from SM to work with.
    • cd ~/catkin_ws
    • rosdep install --from-paths src --ignore-src -r -y
    • sudo apt-get install ros-melodic-moveit
    • sudo apt-get install ros-melodic-joint-state-publisher ros-melodic-joint-state-publisher-gui
    • sudo apt-get install ros-melodic-gazebo-ros-control joint-state-publisher
    • sudo apt-get install ros-melodic-ros-controllers ros-melodic-ros-control
    • open a file (bashrc) : sudo nano ~/.bashrc.
    • At the end of the file add the follwing linesource /home/mo7dsaleh/catkin_ws/devel/setup.bash then press ctrl + o, (Note that mo7dsaleh is my ubuntu username).
    • source ~/.bashrc
    • To lunch the Rviz simulator with slider motors control (joint_state_publisher) use this command roslaunch robot_arm_pkg check_motors.launch
    • Rviz Simulator:

    Circuit Diagram

  4. To control the robot arm physically if you need, connect the circuit diagram with your arm and the install Arduino IDE and ros_lib.

    • Circuit Wiring:

    Circuit Diagram

    • Install Arduino IDE software wget https://downloads.arduino.cc/arduino-1.8.12-linux64.tar.xz then tar -xvf arduino-1.8.12-linux64.tar.xz then cd arduino-1.8.12/ then sudo ./install.sh
    • Download rosserial to communicate with arduino using the following commands sudo apt-get install ros-melodic-rosserial-arduino then sudo apt-get install ros-melodic-rosserial
    • Download ros_lib on arduino software using the following commands cd Arduino/libraries then rm -rf ros_lib then rosrun rosserial_arduino make_libraries.py .
    • To upload the Arduino code, select the Arduino port to be used on Ubuntu system, then we need to change the permissions (it might be ttyACM) by ls -l /dev |grep ttyUSB then sudo chmod -R 777 /dev/ttyUSB0 then upload the code from Arduino IDE
    • Run Rviz roslaunch robot_arm_pkg check_motors.launch rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0 _baud:=115200
  5. Control the Arm in Gazebo simulator (real simulation).

    • Change the permission cd catkin/src/arduino_robot_arm/robot_arm_pkg/scripts then sudo chmod +x joint_states_to_gazebo.py
    • Open new terminal to launch Rviz roslaunch robot_arm_pkg check_motors.launch
    • Open new terminal to launch Gazebo roslaunch robot_arm_pkg check_motors_gazebo.launch
    • Then run the python script to communicate with Gazebo rosrun robot_arm_pkg joint_states_to_gazebo.py
    • Rviz with Gazebo:

    Rviz with Gazebo

    • Different Angles:

    Diiferan Angles

  6. Now, lets used Moveit in Rvis which will help for kinematics, motion planning, trajectory processing and controlling the robot

    • roslaunch moveit_pkg demo.launch
    • Moveit:

    Diiferan Angles

  7. Task is Done ๐Ÿ˜

robot_arm_control_in_ros's People

Contributors

mo7ammed-saleh avatar

Stargazers

 avatar  avatar Abdullah AlShenaifi avatar Moneera Banjar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.