Giter Club home page Giter Club logo

safemotions's Introduction

Learning Collision-free and Torque-limited Robot Trajectories based on Alternative Safe Behaviors

IEEE Humanoids 2022 arXiv PyPI version PyPI license GitHub issues
This repository provides the code to learn torque-limited and collision-free robot trajectories without exceeding limits on the position, velocity, acceleration and jerk of each robot joint.

safemotions_picture

Installation

To use the code, clone the repository with:

git clone https://github.com/translearn/safeMotions.git

The required dependencies can be installed by running:

pip install -r requirements.txt

Trajectory generation   Open In Colab

To generate a random trajectory with a single robot run

python safemotions/random_agent.py --use_gui --check_braking_trajectory_collisions --check_braking_trajectory_torque_limits --torque_limit_factor=0.6 --plot_trajectory

For a demonstration scenario with two robots run

python safemotions/random_agent.py --use_gui --check_braking_trajectory_collisions --robot_scene=1

Collision-free trajectories for three robots can be generated by running

python safemotions/random_agent.py --use_gui --check_braking_trajectory_collisions --robot_scene=2

Pretrained networks   Open In Colab

Various pretrained networks for reaching randomly sampled target points are provided.
Make sure you use ray==1.4.1 to open the pretrained networks.

Industrial robots

To generate and plot trajectories for a reaching task with a single industrial robot run

python safemotions/evaluate.py --use_gui --plot_trajectory --plot_actual_torques --checkpoint=industrial/one_robot/collision 

Trajectories for two and three industrial robots with alternating target points can be generated by running

python safemotions/evaluate.py --use_gui --checkpoint=industrial/two_robots/collision/alternating  

and

python safemotions/evaluate.py --use_gui --checkpoint=industrial/three_robots/collision/alternating  

Humanoid robots

ARMAR 6 ARMAR 6x4
Alternating target points --checkpoint=humanoid/armar6/collision/alternating --checkpoint=humanoid/armar6_x4/collision/alternating
Simultaneous target points --checkpoint=humanoid/armar6/collision/simultaneous --checkpoint=humanoid/armar6_x4/collision/simultaneous
Single target point --checkpoint=humanoid/armar6/collision/single --checkpoint=humanoid/armar6_x4/collision/single

Training

Networks can also be trained from scratch. For instance, a reaching task with a single robot can be learned by running

python safemotions/train.py --logdir=safemotions_training --name=industrial_one_robot_collision --robot_scene=0 --online_trajectory_time_step=0.1 --hidden_layer_activation=swish --online_trajectory_duration=8.0 --obstacle_scene=3 --use_target_points --target_point_sequence=0 --target_point_cartesian_range_scene=0 --target_link_offset="[0, 0, 0.126]" --target_point_radius=0.065 --obs_add_target_point_pos --obs_add_target_point_relative_pos --check_braking_trajectory_collisions --closest_point_safety_distance=0.01 --acc_limit_factor_braking=1.0 --jerk_limit_factor_braking=1.0 --punish_action --action_punishment_min_threshold=0.95 --action_max_punishment=0.4  --target_point_reached_reward_bonus=5  --pos_limit_factor=1.0 --vel_limit_factor=1.0 --acc_limit_factor=1.0 --jerk_limit_factor=1.0 --torque_limit_factor=1.0 --punish_braking_trajectory_min_distance --braking_trajectory_min_distance_max_threshold=0.05 --braking_trajectory_max_punishment=0.5 --last_layer_activation=tanh --solver_iterations=50 --normalize_reward_to_initial_target_point_distance --collision_check_time=0.033 --iterations_per_checkpoint=50 --time=200

Publication

The corresponding publication is available at https://arxiv.org/abs/2103.03793.

Video

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

safemotions's People

Contributors

translearn 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.