Kernel: Python 3 (system-wide)
In [5]:
In [6]:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: jiminy_py in /usr/local/lib/python3.10/dist-packages (1.7.13)
Requirement already satisfied: typing-extensions>=3.10.0 in /usr/local/lib/python3.10/dist-packages (from jiminy_py) (4.5.0)
Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from jiminy_py) (4.66.1)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f15be7a7e50>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/numpy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f15be7a6110>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/numpy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f15be5b8130>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/numpy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f15be5b9630>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/numpy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f15be5b9ae0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/numpy/
In [0]:
In [2]:
In [3]:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_887/1964093056.py in <cell line: 2>()
1 # Enable matplotlib interactive notebook integration
----> 2 get_ipython().run_line_magic('matplotlib', 'widget')
/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2416 kwargs['local_ns'] = self.get_local_scope(stack_depth)
2417 with self.builtin_trap:
-> 2418 result = fn(*args, **kwargs)
2419 return result
2420
/usr/local/lib/python3.10/dist-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)
233 fun.__name__ = func.__name__
234 fun.__doc__ = func.__doc__
/usr/local/lib/python3.10/dist-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
--> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):
/usr/local/lib/python3.10/dist-packages/IPython/core/magics/pylab.py in matplotlib(self, line)
97 print("Available matplotlib backends: %s" % backends_list)
98 else:
---> 99 gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui)
100 self._show_matplotlib_backend(args.gui, backend)
101
/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui)
3645 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
3646
-> 3647 pt.activate_matplotlib(backend)
3648 configure_inline_support(self, backend)
3649
/usr/local/lib/python3.10/dist-packages/IPython/core/pylabtools.py in activate_matplotlib(backend)
357 from matplotlib import pyplot as plt
358
--> 359 plt.switch_backend(backend)
360
361 plt.show._needmain = False
/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py in switch_backend(newbackend)
269 old_backend = dict.__getitem__(rcParams, 'backend')
270
--> 271 backend_mod = importlib.import_module(
272 cbook._backend_module_name(newbackend))
273
/usr/lib/python3.10/importlib/__init__.py in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
127
128
/usr/lib/python3.10/importlib/_bootstrap.py in _gcd_import(name, package, level)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load(name, import_)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
/usr/lib/python3.10/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
/usr/lib/python3.10/importlib/_bootstrap.py in _gcd_import(name, package, level)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load(name, import_)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
ModuleNotFoundError: No module named 'ipympl'
In [0]:
In [0]:
In [0]:
Flexible arm
Instantiate a robot
In [6]:
jiminy_py.core.hresult_t.SUCCESS
In [7]:
jiminy_py.core.hresult_t.SUCCESS
Instantiate a controller
In [8]:
In [9]:
jiminy_py.core.hresult_t.SUCCESS
Instantiate a simulator
In [10]:
In [11]:
jiminy_py.core.hresult_t.SUCCESS
In [12]:
{'contacts': {'transitionVelocity': 0.01,
'transitionEps': 0.001,
'friction': 1.0,
'stabilizationFreq': 20.0,
'torsion': 0.0,
'damping': 2000.0,
'stiffness': 1000000.0,
'model': 'constraint'},
'constraints': {'successiveSolveFailedMax': 100,
'regularization': 0.001,
'solver': 'PGS'},
'joints': {'boundDamping': 10000.0, 'boundStiffness': 10000000.0},
'world': {'groundProfile': <jiminy_py.core.HeightmapFunctor at 0x7fc6baf36dc0>,
'gravity': array([ 0. , 0. , -9.81, 0. , 0. , 0. ])},
'stepper': {'logInternalStepperSteps': False,
'controllerUpdatePeriod': 0.001,
'iterMax': 0,
'sensorsUpdatePeriod': 0.0,
'successiveIterFailedMax': 1000,
'timeout': 0.0,
'dtRestoreThresholdRel': 0.2,
'tolAbs': 1e-05,
'dtMax': 0.000125,
'tolRel': 0.0001,
'odeSolver': 'runge_kutta_4',
'randomSeed': 0,
'verbose': False},
'telemetry': {'enableEnergy': True,
'enableMotorEffort': True,
'enableCommand': True,
'enableForceExternal': False,
'enableAcceleration': True,
'enableVelocity': True,
'enableConfiguration': True,
'isPersistent': True}}
Simulate the system
In [13]:
In [14]:
Rendering frames: 100%|██████████| 120/120 [00:00<00:00, 124.67it/s]
WARNING: Some output was deleted.
In [15]:
Figure
In [16]:
In [17]:
array([ 0. , 0. , -0.0031466])
In [18]:
Figure
In [19]:
WARNING:root:Matplotlib's 'widget' and 'inline' backends are not properly supported. Please add '%matplotlib notebook' at the top and restart the kernel.
jiminy
In [0]: