Skip to content

Instantly share code, notes, and snippets.

View adamkewley's full-sized avatar

Adam Kewley adamkewley

View GitHub Profile
@adamkewley
adamkewley / opensim-creator_661_repro.osim
Created February 23, 2023 15:27
An OpenSim4 osim file that segfaults after the model is copy-constructed. Crashes on-load in OpenSim Creator, and on running a forward-dynamic simulation in OpenSim GUI.
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="model">
<!--The model's ground reference frame.-->
<Ground name="ground">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
@adamkewley
adamkewley / CMakeSettings.json
Created February 14, 2023 12:17 — forked from mluparu/CMakeSettings.json
CMake in Visual Studio: MinGW configuration targeting both x64 and i686
{
"configurations": [
{
"environments": [
{
"MINGW64_ROOT": "C:\\msys64\\mingw64",
"BIN_ROOT": "${env.MINGW64_ROOT}\\bin",
"FLAVOR": "x86_64-w64-mingw32",
"TOOLSET_VERSION": "7.3.0",
"INCLUDE": "${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\tr1;${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\${env.FLAVOR}",
@adamkewley
adamkewley / simplified_opensim_build_guide.ps1
Last active January 18, 2023 09:17
A simplified version of the opensim-core build instructions, for C++ developers.
# this is a semi-manual guide for setting up a Visual Studio 2022-based
# development environment for opensim-core
#
# you can run the script, but it only builds OpenSim's dependencies - you
# have to manually set up Visual Studio because it has in-built CMake support
#
# before doing this you need to install:
#
# - CMake (https://cmake.org/download/)
# - Git (https://git-scm.com/downloads)
@adamkewley
adamkewley / SpringGeneralizedForceSegfault.osim
Created January 3, 2023 10:23
osim file that segfaults OpenSim 4.4
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="model">
<!--The model's ground reference frame.-->
<Ground name="ground">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
@adamkewley
adamkewley / PointToPointActuatorSegfault.osim
Created January 3, 2023 10:02
osim file that segfaults OpenSim 4.4
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="model">
<!--The model's ground reference frame.-->
<Ground name="ground">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
@adamkewley
adamkewley / aca_segfault.osim
Created January 3, 2023 09:24
Model file that segfaults OpenSim 4.4
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="model">
<!--The model's ground reference frame.-->
<Ground name="ground">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
@adamkewley
adamkewley / ccc_segfault.osim
Created January 3, 2023 09:04
osim file that segfaults OpenSim 4.4
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="model">
<!--The model's ground reference frame.-->
<Ground name="ground">
<!--The geometry used to display the axes of this Frame.-->
<FrameGeometry name="frame_geometry">
<!--Path to a Component that satisfies the Socket 'frame' of type Frame.-->
<socket_frame>..</socket_frame>
<!--Scale factors in X, Y, Z directions respectively.-->
@adamkewley
adamkewley / SD_Test.ino
Last active September 7, 2023 09:01
Connect to an SD card via Arduino
/*
* This program attempts to initialize an SD card and analyze its structure.
*/
#include "SdFat.h"
#include "sdios.h"
/*
Set DISABLE_CS_PIN to disable a second SPI device.
For example, with the Ethernet shield, set DISABLE_CS_PIN
to 10 to disable the Ethernet controller.
*/
@adamkewley
adamkewley / Rajagopal2015_SegfaultOnLoad.osim
Last active October 11, 2022 13:44
An osim file that segfaults upon being loaded via OpenSim 4.4
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSimDocument Version="40000">
<Model name="FullBodyModel_MuscleActuatedLowerLimb_TorqueActuatedUpperBody">
<defaults>
<ControlLinear name="default">
<is_model_control>true</is_model_control>
<extrapolate>true</extrapolate>
<default_min>-1</default_min>
<default_max>1</default_max>
<filter_on>false</filter_on>
@adamkewley
adamkewley / BuildOpenSimGUI.sh
Last active February 25, 2023 12:40
Build OpenSim GUI (4.4) from source on Ubuntu22
#!/usr/bin/env bash
set -xeuo pipefail
BUILDGUI_ROOT=$PWD
BUILDGUI_CONCURRENCY=4
# install platform dependencies
if true; then
cd ${BUILDGUI_ROOT}