$ rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0 _baud:=115200 You can also connect with hardware by running: $ roslaunch robot_arm_pkg check_motors.launch Make sure to change the port permission before uploading the Arduino code $ sudo chmod 777 /dev/ttyUSB0 Usage:Ĭontrolling the robot arm by joint_state_publisher: Install the arduino package and ros library
Install Arduino IDE in Ubuntu to install run $ sudo. Gripper :0(closed) Configuring Arduino with ROS: The robot arm has 5 joints only 4 joints can be fully controlled via ROS and Rviz, the last joint (gripper) has a default motion executed from the Arduino code directly. $ sudo apt-get install ros-noetic-ros-controllers ros-noetic-ros-control Robot Arm: $ sudo apt-get install ros-noetic-gazebo-ros-control joint-state-publisher $ sudo apt-get install ros-noetic-joint-state-publisher ros-noetic-joint-state-publisher-gui $ sudo apt-get install ros-melodic-ros-controllers ros-melodic-ros-control $ sudo apt-get install ros-melodic-gazebo-ros-control joint-state-publisher $ sudo apt-get install ros-melodic-joint-state-publisher ros-melodic-joint-state-publisher-gui $ sudo apt-get install ros-melodic-moveit $ sudo apt-get install ros-kinetic-ros-controllers ros-kinetic-ros-control
$ sudo apt-get install ros-kinetic-gazebo-ros-control joint-state-publisher $ sudo apt-get install ros-kinetic-joint-state-publisher ros-kinetic-joint-state-publisher-gui $ sudo apt-get install ros-kinetic-moveit Make sure you installed all these packages: $ rosdep install -from-paths src -ignore-src -r -y Run this instruction inside your workspace: These packages can be tested in the gazebo simulation tool and the real robot arm, where the ROS system and Arduino code share the /joint_states topic to control motors. The robot arm uses Moveit plugin to apply kinematics by the KDL solver. These packages were tested under ROS kinetic and Ubuntu 16.04 and it works perfectly on ROS melodic and noetic ROS packages that can be used to plan and execute motion trajectories for a robot arm in simulation and real-life.