Skip to content

Toonzaza/Fun4_RoboticDev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

3 DOF Robot Controller Simulation : Hello World

This repository features a simulation of a 3 Degrees of Freedom (DOF) robotic arm controller. The objective of the project is to simulate the control of a 3 DOF robotic arm, enabling it to reach a desired setpoint by regulating the joint velocities using Jacobian matrices.

Project Overview

  • This simulation project uses the Robotics Toolbox for Python to modeland control a 3 DOF robot.
  • Generating a robot model using the xacro urdf file.
  • Visualized the robot model in RVIZ2.
  • Controlling the robot's end-effector by computing joint velocities using the Jacobian.

Features

  • Controlling the robot's end-effector by Jacobian.
  • The robot can be controlled in 3 modes:
    • Control by specifying a target position
    • Control using teleop_twist_keyboard
    • Control by random target position selection

Prerequisites

To run this project, ensure you have the following installed:

System Architecture

image

Installation

Install & upgrade python3-pip.

sudo apt-get install python3-pip
python3 -m pip install --upgrade pip
pip3 install -U pip

Install Robotics Toolbox for Python using pip3.

pip3 install roboticstoolbox-python

For use Robotics Toolbox for Python have to use numpy < 1.25.0

pip3 install numpy==1.24.4

Clone this workspace in to your terminal.

git clone https://github.com/Toonzaza/Fun4_RoboticDev.git

Go to the project directory.

cd Fun4_RoboticDev

Build and source this project.

colcon build && source install/setup.bash

Part 1: Setup Environment

For finding robot workspace of RRR robot.

  1. Create the DH parameter of the RRR robot.
  2. limit of q1 q2 q3 and sample all possible data that q1 q2 q3 can go to that position.
  3. Use Loop for plot position to a graph.

image

You can try it by running the code. : work_space.py

cd Fun4_RoboticDev/src/RoboticsDev2024/scripts

code .

You can see position of target and position of end-effector in this picture.

image

Part 2: Controller

Custom service

## Don't coppy this code. ##

Name : /set_mode

Request : mode --> Enter mode 1-3.
            x  --> Enter qx
            y  --> Enter qy
            z  --> Enter qz
            
Respond : state  --> Show current status
  1. Inverse Pose Kinematics (IPK)

First you must run this command to open the launch file.

ros2 launch example_description fun.launch.py 

For IPK you must open new terminal and enter mode: 1 and enter qx qy qz in x y z.

ros2 service call /set_mode fun4_interfaces/srv/Mode "mode: 1
x: 0.0
y: 0.05
z: 0.3"

If you find the answer in taskspace.

image

If answer not in taskspace.

image

  1. Teleoperation

If you want to play this mode you must open new terminal and run this command.

ros2 run teleop_twist_keyboard teleop_twist_keyboard 

Commanding /cmd_vel in Teleoperation mode can be commanded in 2 modes:

Reference End-effector

ros2 service call /set_mode fun4_interfaces/srv/Mode "mode: 2
x: 0.0
y: 0.0
z: 0.0" 

Reference Base

ros2 service call /set_mode fun4_interfaces/srv/Mode "mode: 2
x: 1.0
y: 0.0
z: 0.0" 

And if while ordering the robot It then detects that the robot is approaching the Singularity condition.

image

  1. Auto

If you want to play this mode you must run this command.

ros2 service call /set_mode fun4_interfaces/srv/Mode "mode: 3
x: 0.0
y: 0.0
z: 0.0" 

Recommendations

If problems occur during use, you should exit and launch again.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published