<commit_before># -*- coding: utf-8 -*-

# Copyright (c) 2010 <NAME> (http://www.jdhp.org)

import math
import numpy as np
import fig

class ArmModel:
    """Vertically planar 2 DoF arm model (sagittal plane).

    <NAME>

    title={{Learning and generation of goal-directed arm reaching from scratch}},
    author={<NAME>. and <NAME>. and <NAME>. and <NAME>. and <NAME>.},
    journal={Neural Networks},
    volume={22},
    number={4},
    pages={348--361},
    year={2009},
    publisher={Elsevier}
    """

    theta_limit = [{'min':-1.75, 'max':0.52},  # Min and max joint angles (rd) (cf. H.Kambara)
                   {'min':-0.35, 'max':1.92}]
    has_theta_limit = True

    theta_init = [0., 0.]                      # Orientation (rd)

    # Bound values for assert
    taumin,   taumax   = -200, 200             # Total torque (N.m)
    alphamin, alphamax = -10E1, 10E1           # Angular acceleration (rd/s²)
    omegamin, omegamax = -2. * math.pi, 2. * math.pi   # Angular velocity (rd/s) from [3] p.19

    # Arm dynamics [upper, lower]
    m  = np.array([1.59, 1.44])                # Limb mass   (kg)
    L  = np.array([0.3,  0.35])                # Limb length (m)
    lg = np.array([0.18, 0.21])                # Distance from the center of mass to the joint (m)
    I  = np.array([6.78E-2, 7.99E-2])          # Rotary inertia of the link around the joint   (kg.m²)
    g  = 9.8                                   # Gravitational acceleration (m/s²)

    def __init__(self, has_theta_limit):
        self.alpha = np.zeros(2)               # Angular acceleration (rd/s²)
        self.omega = np.zeros(2)               # Angular velocity (rd/s)
        self.theta = np.array(self.theta_init) # Orientation (rd)

        self.has_theta_limit = has_theta_limit
        if self.has_theta_limit:
            self.limit_theta()

        # Init datas to plot (name, title, xlabel, ylabel)
        fig.subfig('alpha',  'Angular acceleration', 'time (s)', 'Angular acceleration (rad/s/s)')
        fig.subfig('omega',  'Angular velocity',     'time (s)', 'Angular velocity (rad/s)')
        fig.subfig('theta',  'Angle',                'time (s)', 'Angle (rad)')<commit_msg>Update min joint angle (Kambara)<commit_after># -*- coding: utf-8 -*-

# Copyright (c) 2010 <NAME> (http://www.jdhp.org)

import math
import numpy as np
import fig

class ArmModel:
    """Vertically planar 2 DoF arm model (sagittal plane).

    <NAME>

    title={{Learning and generation of goal-directed arm reaching from scratch}},
    author={<NAME>. and <NAME>. and <NAME>. and <NAME>. and <NAME>.},
    journal={Neural Networks},
    volume={22},
    number={4},
    pages={348--361},
    year={2009},
    publisher={Elsevier}
    """

    theta_limit = [{'min':-1.75, 'max':0.52},  # Min and max joint angles (rd) (cf. H.Kambara)
    #               {'min':-0.35, 'max':1.92}]
                   {'min':0., 'max':1.92}]
    has_theta_limit = True

    theta_init = [0., 0.]                      # Orientation (rd)

    # Bound values for assert
    taumin,   taumax   = -200, 200             # Total torque (N.m)
    alphamin, alphamax = -10E1, 10E1           # Angular acceleration (rd/s²)
    omegamin, omegamax = -2. * math.pi, 2. * math.pi   # Angular velocity (rd/s) from [3] p.19

    # Arm dynamics [upper, lower]
    m  = np.array([1.59, 1.44])                # Limb mass   (kg)
    L  = np.array([0.3,  0.35])                # Limb length (m)
    lg = np.array([0.18, 0.21])                # Distance from the center of mass to the joint (m)
    I  = np.array([6.78E-2, 7.99E-2])          # Rotary inertia of the link around the joint   (kg.m²)
    g  = 9.8                                   # Gravitational acceleration (m/s²)

    def __init__(self, has_theta_limit):
        self.alpha = np.zeros(2)               # Angular acceleration (rd/s²)
        self.omega = np.zeros(2)               # Angular velocity (rd/s)
        self.theta = np.array(self.theta_init) # Orientation (rd)

        self.has_theta_limit = has_theta_limit
        if self.has_theta_limit:
            self.limit_theta()

        # Init datas to plot (name, title, xlabel, ylabel)
        fig.subfig('alpha',  'Angular acceleration', 'time (s)', 'Angular acceleration (rad/s/s)')
        fig.subfig('omega',  'Angular velocity',     'time (s)', 'Angular velocity (rad/s)')
        fig.subfig('theta',  'Angle',                'time (s)', 'Angle (rad)')
{'fraction_non_alphanumeric': 0.15150146759990968, 'fraction_numerical': 0.036577105441408894, 'mean_word_length': 2.0095108695652173, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6303101', 'n_tokens_mistral': 1634, 'n_tokens_neox': 1471, 'n_words': 405}