Git Product home page Git Product logo

robotic_arm_environment's Introduction


Robotic Arm Simulation in ROS2 and Gazebo

Note:

I will take this project again very soon; the idea is to use state-of-the-art RL algorithms. Also, move to the new gazebo and the latest ROS version. Please let me know if you want to collaborate.

General Overview

This repository includes: First, how to simulate a 6DoF Robotic Arm from scratch using GAZEBO and ROS2. Second, it provides a custom Reinforcement Learning Environment where you can test the Robotic Arm with your RL algorithms. Finally, we test the simulation and environment with a reacher target task, using RL and the 6DoF Robotic Arm with a visual target point.

Prerequisites

Library Version (TESTED)
Ubuntu 20.04
ROS2 Foxy link
ros2_control link
gazebo_ros2_control link

How to run this Repository

In the following links you can find a step-by-step instruction section to run this repository and simulate the robotic arm:

  • Simulation in Gazebo and ROS2 --> Tutorial-link

    • Configurate and spawn the robotic arm in Gazebo.
    • Move the robot with a simple position controller.
  • Custom RL Environment --> Tutorial-link

    • A complete Reinforcement Learning environment simulation.
  • Reacher task with RL --> Cooming soon

    • Robot reacher task.

Citation

If you use either the code, data or the step from the tutorial-blog in your paper or project, please kindly star this repo and cite our webpage

Acknowledgement

I want to thank Doosan Robotics for their repositories, and packages where they took part of this code.

Also, thanks to the authors of these repositories and their tutorials where I took some ideas

Contact

Please feel free to contact me or open an issue if you have questions or need additional explanations.

The released codes are only allowed for non-commercial use.

robotic_arm_environment's People

Contributors

dvalenciar avatar matteogrechi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

robotic_arm_environment's Issues

RuntimeError: Signal event received before subprocess transport available.

Hy while executing ```
cd ros2_ws

. install/setup.bash

ros2 launch my_doosan_pkg my_doosan_gazebo.launch.py

I get the following error: 
```
`[INFO] [launch]: All log files can be found below /home/florian/.ros/log/2022-11-26-12-01-48-262247-florian-X580VD-213158
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=PackageNotFoundError("package 'gazebo_ros' not found, searching: ['/home/florian/r2_ws/install/my_doosan_pkg', '/home/florian/r2_ws/install/gz_snap_ros2_control_demos', '/opt/ros/foxy']")>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/packages.py", line 50, in get_package_prefix
    content, package_prefix = get_resource('packages', package_name)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/resources.py", line 48, in get_resource
    raise LookupError(
LookupError: Could not find the resource 'gazebo_ros' of type 'packages'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 453, in execute
    ret = super().execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 823, in execute
    self.__expand_substitutions(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 668, in __expand_substitutions
    cmd = [perform_substitutions(context, x) for x in self.__cmd]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 668, in <listcomp>
    cmd = [perform_substitutions(context, x) for x in self.__cmd]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 232, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/executable_in_package.py", line 76, in perform
    package_prefix = super().perform(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/find_package.py", line 79, in perform
    result = self.find(package)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/substitutions/find_package.py", line 96, in find
    return get_package_prefix(package_name)
  File "/opt/ros/foxy/lib/python3.8/site-packages/ament_index_python/packages.py", line 52, in get_package_prefix
    raise PackageNotFoundError(
ament_index_python.packages.PackageNotFoundError: "package 'gazebo_ros' not found, searching: ['/home/florian/r2_ws/install/my_doosan_pkg', '/home/florian/r2_ws/install/gz_snap_ros2_control_demos', '/opt/ros/foxy']"
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=RuntimeError('Signal event received before subprocess transport available.')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/opaque_function.py", line 75, in execute
    return self.__function(context, *self.__args, **self.__kwargs)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 443, in __on_signal_process_event
    raise RuntimeError('Signal event received before subprocess transport available.')
RuntimeError: Signal event received before subprocess transport available.
[INFO] [robot_state_publisher-1]: process started with pid [213161]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_0 had 1 children
[robot_state_publisher-1] Link link1 had 1 children
[robot_state_publisher-1] Link link2 had 1 children
[robot_state_publisher-1] Link link3 had 1 children
[robot_state_publisher-1] Link link4 had 1 children
[robot_state_publisher-1] Link link5 had 1 children
[robot_state_publisher-1] Link link6 had 0 children
[robot_state_publisher-1] [INFO] [1669460508.868788604] [robot_state_publisher]: got segment base_0
[robot_state_publisher-1] [INFO] [1669460508.868970600] [robot_state_publisher]: got segment link1
[robot_state_publisher-1] [INFO] [1669460508.868987886] [robot_state_publisher]: got segment link2
[robot_state_publisher-1] [INFO] [1669460508.868996441] [robot_state_publisher]: got segment link3
[robot_state_publisher-1] [INFO] [1669460508.869004264] [robot_state_publisher]: got segment link4
[robot_state_publisher-1] [INFO] [1669460508.869011514] [robot_state_publisher]: got segment link5
[robot_state_publisher-1] [INFO] [1669460508.869018581] [robot_state_publisher]: got segment link6
[robot_state_publisher-1] [INFO] [1669460508.869031652] [robot_state_publisher]: got segment world
[ERROR] [robot_state_publisher-1]: process[robot_state_publisher-1] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [robot_state_publisher-1]: sending signal 'SIGTERM' to process[robot_state_publisher-1]
[ERROR] [robot_state_publisher-1]: process has died [pid 213161, exit code -15, cmd '/opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher --ros-args -r __node:=robot_state_publisher --params-file /tmp/launch_params_p8x92nsl']`
```

Error loading controller issue for running my_doosan_gazebo_controller.launch.py

Hi @dvalenciar

I'm trying to make reinforcement learning simulation. Your project is very good for me. However I have some issues in here.
I have completed all courses according to the tutorial. However, when I run the model with the last Gazebo connected to the controller, the controller is not loaded and I cannot see any movement in the robot simulation.
What part can I fix?

Below is my error code.

[gazebo-3] [WARN] [1681806028.508642143] [gazebo_ros2_control]: Desired controller update period (0.01 s) is slower than the gazebo simulation period (0.001 s).
[gazebo-3] [INFO] [1681806028.508960215] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[gazebo-3] [INFO] [1681806028.577406518] [controller_manager]: Loading controller 'joint_state_broadcaster'
[gazebo-3] [ERROR] [1681806028.577471666] [controller_manager]: Loader for controller 'joint_state_broadcaster' not found.
[gazebo-3] [INFO] [1681806028.577480973] [controller_manager]: Available classes:
[gazebo-3] [INFO] [1681806028.577527792] [controller_manager]: controller_manager/test_controller
[gazebo-3] [INFO] [1681806028.577542035] [controller_manager]: controller_manager/test_controller_failed_init
[gazebo-3] [INFO] [1681806028.577551302] [controller_manager]: controller_manager/test_controller_with_interfaces
[ros2-4] Error loading controller, check controller_manager logs
[ERROR] [ros2-4]: process has died [pid 38167, exit code 1, cmd 'ros2 control load_controller --set-state start joint_state_broadcaster'].
[gazebo-3] [INFO] [1681806028.608571508] [controller_manager]: Loading controller 'joint_trajectory_controller'
[gazebo-3] [ERROR] [1681806028.608603854] [controller_manager]: Loader for controller 'joint_trajectory_controller' not found.
[gazebo-3] [INFO] [1681806028.608610576] [controller_manager]: Available classes:
[gazebo-3] [INFO] [1681806028.608619301] [controller_manager]: controller_manager/test_controller
[gazebo-3] [INFO] [1681806028.608624592] [controller_manager]: controller_manager/test_controller_failed_init
[gazebo-3] [INFO] [1681806028.608629503] [controller_manager]: controller_manager/test_controller_with_interfaces
[ros2-5] Error loading controller, check controller_manager logs
[ERROR] [ros2-5]: process has died [pid 38169, exit code 1, cmd 'ros2 control load_controller --set-state start joint_trajectory_controller'].

Run trajectory_points_act_server do nothing

Thank you for your work. I have successfully do all the steps except the last one. When I run ros2 run my_doosan_pkg trajectory_points_act_server, the terminal show nothing, and the robot in gazebo stay still. Do you know what happen?
My os: ubuntu 20
Ros version: ros foxy

Inverse Kinematics

Hey @dvalenciar,

First of all, thanks for sharing this project, I followed your instructions and everything works great.
I created a .devcontainer in VSCode, with all the necessary dependencies, and everything is running inside a container, I can contribute it if you are interested.

I want to use your setup for a simple simulation where the controller is moving the tip to a specific position - meaning I want to send [x, y, z] point to the controller (where [x, y, z] are in world coordinate). Is there any inverse kinematics calculation of this robot, which will give me the required joint positions?

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.