Skip to content

Force::isDisabled -->> Force::appliesForce #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 158 commits into from
Dec 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
35dd2b6
Merge remote-tracking branch 'opensim-org/tablesource_filename_proper…
chrisdembia Jun 14, 2016
ee2b482
Allow (de)serialization of inputs.
chrisdembia Jun 15, 2016
b2ca3b8
Merge branch 'master' of github.com:opensim-org/opensim-core into ser…
chrisdembia Jun 15, 2016
bbdf177
Update property index for connectors and inputs.
chrisdembia Jun 16, 2016
645dd34
Revert static optimization passive force test model.
chrisdembia Jun 16, 2016
55558a8
Merge remote-tracking branches 'opensim-org' and 'opensim-org/tableso…
chrisdembia Jun 18, 2016
7ba8a90
No need to avoid BTK; test now uses trc.
chrisdembia Jun 18, 2016
51f070c
Merge branch 'master' of github.com:opensim-org/opensim-core into ser…
chrisdembia Jun 21, 2016
e59cd7d
Respond to @aseth1's review.
chrisdembia Jun 23, 2016
adfd739
Merge branch 'enable_addComponent_to_replace_type_specific_add_method…
chrisdembia Jun 25, 2016
84e486c
Merge branch 'master' of github.com:opensim-org/opensim-core into ser…
chrisdembia Jun 25, 2016
acabcb6
Merge branch 'master' into serialize-inputs
chrisdembia Oct 1, 2016
c9ca548
DECLARE_INPUT creates a property.
chrisdembia Oct 3, 2016
f007dfb
Partially functioning, using string name to get property.
chrisdembia Oct 7, 2016
d24e30e
Marker Super::updateFromXMLNode().
chrisdembia Oct 10, 2016
4a952ae
First working version of moving connectee_name prop.
chrisdembia Oct 10, 2016
040dc0c
Rename connectee name property.
chrisdembia Oct 10, 2016
22331da
Connectors no longer derive from Object.
chrisdembia Oct 10, 2016
f5dab4e
Simplify how Connector::_isList is determined.
chrisdembia Oct 10, 2016
5fbccbf
No longer pass Object& to Connectors.
chrisdembia Oct 11, 2016
7344fe4
Changes to const_casting Connector's owner.
chrisdembia Oct 11, 2016
2519dc2
Make Connector constructors protected.
chrisdembia Oct 11, 2016
c142109
Greatly simplify macro for connectee_name property.
chrisdembia Oct 11, 2016
2282af0
Roll back changes to Property.h. Create comment for connectee_name pr…
chrisdembia Oct 12, 2016
4570362
Doxygen note about unsupported custom copy ctor.
chrisdembia Oct 12, 2016
91ad4cf
Remove TODO comment about "single-value"
chrisdembia Oct 12, 2016
034ad53
Merge branch 'master' of github.com:opensim-org/opensim-core into con…
chrisdembia Oct 12, 2016
67c1b7c
Remove unneeded registerTypes() for Connectors, etc.
chrisdembia Oct 12, 2016
34557bb
testComponents now hooks up Inputs.
chrisdembia Oct 12, 2016
f1d8515
Improve doxygen docs; delete old code.
chrisdembia Oct 13, 2016
c1a99f8
Fix python/matlab tests for annotation->alias, etc.
chrisdembia Oct 13, 2016
03deac6
Merge branch 'master' of github.com:opensim-org/opensim-core into con…
chrisdembia Oct 13, 2016
b0fd15e
For docopt, use static library.
chrisdembia Oct 17, 2016
69f95ff
Merge branch 'master' of github.com:opensim-org/opensim-core into doc…
chrisdembia Oct 17, 2016
36149c2
Merge branch 'master' of https://github.com/opensim-org/opensim-core …
aymanhab Oct 25, 2016
7983317
Merge branch 'master' into display_hints_improvements
aymanhab Nov 1, 2016
6f0eea7
Test model that exhibits all supported types of wrapObjects (Cylinder…
aymanhab Nov 1, 2016
53e655c
Add display_scale_factor to ModelDisplayHints and use it to scale Mar…
aymanhab Nov 3, 2016
69c81de
implement generateDecorations for WrapTorus
aymanhab Nov 5, 2016
65f2675
Move creation of connectee_name property inside construct*() methods.
chrisdembia Nov 10, 2016
b50130e
Merge branch 'master' of github.com:opensim-org/opensim-core into con…
chrisdembia Nov 10, 2016
75f553b
Use ComponentPath to validate connectee_name.
chrisdembia Nov 10, 2016
6e50847
Merge branch 'master' into visualize_wrap_torus_ellipsoid
aymanhab Nov 10, 2016
6a5552a
Untangle DisplayHints changes from Wrap object support branch
aymanhab Nov 10, 2016
dd6811e
Remove references to meshes from test_wrapAllVis.osim
aymanhab Nov 10, 2016
c3ab550
Test exception message for connectee type mismatch.
chrisdembia Nov 10, 2016
4cc6ad9
Update docs for updateConnectors30508.
chrisdembia Nov 10, 2016
4740477
Merge branch 'master' of github.com:opensim-org/opensim-core into doc…
chrisdembia Nov 10, 2016
b0b47f0
Use latest docopt for windows static lib support.
chrisdembia Nov 10, 2016
0d8e905
Add model with wrapObjects and beefup test case to compare. still wor…
aymanhab Nov 10, 2016
9c9ea69
Remove temporary call to model.connect().
chrisdembia Nov 11, 2016
64e04af
[cmake] Add missing parenthesis
chrisdembia Nov 11, 2016
00aed6e
[travis] 2 parallel jobs for clang with bindings.
chrisdembia Nov 11, 2016
9433d07
Use better numbers for easier comparison
aymanhab Nov 14, 2016
1835ebe
Merge branch 'visualize_wrap_torus_ellipsoid' of https://github.com/o…
aymanhab Nov 14, 2016
7735dae
simplify numbers for geometry transforms
aymanhab Nov 14, 2016
ebf1a27
Primitives for WrapObject(s) in testVisualization.cpp
aymanhab Nov 14, 2016
a26d430
Set all attributes of DeoorativeGeometry created by Wrap objects
aymanhab Nov 14, 2016
bd43c60
Beef up testVisualization to include a model with WrapCylinders, Wrap…
aymanhab Nov 14, 2016
0dab589
Add a test case to verify the different possible motion types that ca…
aseth1 Nov 15, 2016
b3163b2
First argument to calc_DFiberForceAT_DFiberLengthAT() should be dFmAT…
tkuchida Nov 15, 2016
dfe83c5
Use display preferences from Appearance object rather than hardcoded …
aymanhab Nov 15, 2016
4281ab0
Merge remote-tracking branch 'remotes/origin/master' into visualize_w…
aymanhab Nov 15, 2016
80aa5aa
Make MotionType test more rigorous by testing for pure Translational(…
aseth1 Nov 15, 2016
a0affb9
Correction to Coordinate motion type classification to designate type…
aseth1 Nov 15, 2016
e712466
Set default opacity to 0.5 for WrapObjects
aymanhab Nov 15, 2016
6e8b9be
Add punctuation to comment
aseth1 Nov 15, 2016
7853a2c
Change property name. Change function names related to the renamed pr…
klshrinidhi Nov 16, 2016
95e97b1
Fix call sites to use the changed property name, changed function names.
klshrinidhi Nov 16, 2016
c623b3a
Fix data files to use renamed property name.
klshrinidhi Nov 16, 2016
955750f
Include an additional test condition to verify that a CustomJoint's i…
aseth1 Nov 16, 2016
7b471c7
Add sanity check that both PinJoint and CustomJoint used to model a p…
aseth1 Nov 16, 2016
d0008cc
Remove visualization code used to visually compare simulations.
aseth1 Nov 16, 2016
9d3e941
Compare difference to fixed offset and also report it prior to ASSERT.
aseth1 Nov 16, 2016
ee4fade
Add a test case output header (so log indicates which test is being e…
aseth1 Nov 16, 2016
01c87e9
Revert "Fix data files to use renamed property name."
klshrinidhi Nov 17, 2016
67e4640
Add overload to appendRow that accepts RowVectorView.
klshrinidhi Nov 17, 2016
cb29b91
Add tests for the added overload.
klshrinidhi Nov 17, 2016
f550bb8
Fix debug failure.
klshrinidhi Nov 17, 2016
524bb93
Comment fix
aseth1 Nov 17, 2016
2663451
Increment xml version. Add function to update property when old model…
klshrinidhi Nov 17, 2016
9f1637f
Test serialization and deserialization.
klshrinidhi Nov 17, 2016
79555bb
Document the change.
klshrinidhi Nov 17, 2016
cb983ca
Comment out MarkersReference::getSpeedValues().
chrisdembia Nov 17, 2016
725039f
Merge branch 'master' of github.com:opensim-org/opensim-core into Mar…
chrisdembia Nov 17, 2016
d93336a
Remove leftovers from merge conflict.
chrisdembia Nov 17, 2016
b4d691d
Improve test by checking for flipped property.
klshrinidhi Nov 18, 2016
1261bd8
Document change in property comment as well.
klshrinidhi Nov 18, 2016
93466e0
Use macro defined (and hidden from doxgen) type alias instead of base…
klshrinidhi Nov 18, 2016
57f3ad8
Document the reason for forward-declaring SpatialVec.
chrisdembia Nov 18, 2016
7443350
Create macro ASSERT_THROW_MSG.
chrisdembia Nov 18, 2016
ee9d137
Catch already-used names for Connectors, Inputs, Outputs.
chrisdembia Nov 18, 2016
0a515f7
Document the side effect of getInput(), getConnector().
chrisdembia Nov 18, 2016
838e09b
Fix doxygen warnings about XML tags.
chrisdembia Nov 18, 2016
aafdd52
Connector::connect update check for orphaned connectees.
chrisdembia Nov 18, 2016
a8d3d10
Leave the value as is if it is empty.
klshrinidhi Nov 18, 2016
3363621
Merge branch 'master' into issue_845_force_isDisabled_to_appliesForce
klshrinidhi Nov 18, 2016
30d806b
Remove unnecessary semicolons.
chrisdembia Nov 19, 2016
15a9fec
Use newer updInput() on Reporters.
chrisdembia Nov 19, 2016
c249625
Create example to show input connectee serialization.
chrisdembia Nov 19, 2016
7b536fe
Reveal macro-generated Object methods in doxygen.
chrisdembia Nov 20, 2016
a7edded
Fixed assert_almost_equal where tol was not used
Gjacquenot Nov 20, 2016
7ab117b
Change default constructors for Path, ComponentPath
chrisdembia Nov 20, 2016
2ef301b
Merge pull request #1411 from opensim-org/MarkersReference_virtual_fu…
aymanhab Nov 21, 2016
ca10fd3
Return const RowVectorView when using getRow.
klshrinidhi Nov 21, 2016
96e37f3
Create MATLAB input-output example.
chrisdembia Nov 22, 2016
04711a9
Update testVisualization per feedback on PR.
aymanhab Nov 22, 2016
0a43b13
Merge branch 'master' into visualize_wrap_torus_ellipsoid
aymanhab Nov 22, 2016
49c377d
Merge pull request #1394 from opensim-org/docopt-static
aymanhab Nov 22, 2016
f631150
Merge pull request #1403 from opensim-org/visualize_wrap_torus_ellipsoid
aymanhab Nov 22, 2016
88516b0
Use full path name when adding components to multibodytree.
klshrinidhi Nov 23, 2016
f211368
Remove debug code.
klshrinidhi Nov 23, 2016
6bfefed
Use getAbsoluteName on ground too.
klshrinidhi Nov 23, 2016
d939397
Make FrameGeometry::generateDecorations enforce hints.show_fames and …
aymanhab Nov 25, 2016
d2c0381
Remove duplicate test in FrameGeometry::generateDecorations
aymanhab Nov 30, 2016
887929e
Merge pull request #1410 from opensim-org/issue_1409_add_getRow_overload
aseth1 Nov 30, 2016
597c1a5
Restore tool tests when NOT BUILD_INDIVIDUAL_APPS
chrisdembia Nov 30, 2016
b93be82
Replace "directly proportional" with linear with slope of 1.
aseth1 Dec 1, 2016
a9f3fce
Unload use of "coupled" in the case that multiple coordinates influen…
aseth1 Dec 1, 2016
bb6568c
Clarify the definition of Coordinate::MotionTypes. [ci skip]
aseth1 Dec 1, 2016
0a1280a
Merge branch 'test_motion_types_for_custom_joint_coordinates' of http…
aseth1 Dec 1, 2016
3194acf
Replicate behavior of MarkerData by removing all the rows when averag…
klshrinidhi Dec 2, 2016
1b98b14
Merge branch 'master' of github.com:opensim-org/opensim-core into con…
chrisdembia Dec 2, 2016
98a73ca
Address minor comments on PR #1340.
chrisdembia Dec 2, 2016
166d7f9
Change syntax of Inputs' connectee_name to use |.
chrisdembia Dec 3, 2016
13205e3
MATLAB inputs test now tests labels.
chrisdembia Dec 3, 2016
f594eb7
Merge pull request #1426 from opensim-org/issue_1419_testscale_failure
aymanhab Dec 3, 2016
3ae1ebc
Merge pull request #1422 from opensim-org/frame_visualization_fixes
aymanhab Dec 3, 2016
d2d2a01
Merge pull request #1340 from opensim-org/connectee_property_in_conta…
aseth1 Dec 3, 2016
5b7412e
Merge pull request #1421 from opensim-org/issue_763_getname_to_getful…
aseth1 Dec 3, 2016
2b57133
Merge branch 'master' of github.com:opensim-org/opensim-core into res…
chrisdembia Dec 4, 2016
e671369
Include dirs in tests.
chrisdembia Dec 4, 2016
cda3765
Merge branch 'master' into test_motion_types_of_joints
aseth1 Dec 5, 2016
15316d8
Merge pull request #1402 from opensim-org/tkuchida-fixBugInMillard201…
aseth1 Dec 5, 2016
188a17e
Merge pull request #1423 from opensim-org/restore_application_tests
aymanhab Dec 5, 2016
391ac8c
Merge pull request #1404 from opensim-org/test_motion_types_for_custo…
aseth1 Dec 5, 2016
6c88abf
Merge branch 'master' of github.com:opensim-org/opensim-core into Pat…
chrisdembia Dec 5, 2016
d5ddba5
Merge pull request #1418 from opensim-org/Path_default_constructors
chrisdembia Dec 6, 2016
ad9949a
Merge pull request #1417 from Gjacquenot/patch-1
aseth1 Dec 7, 2016
ebb7422
Throw exception when requesting value of unconnected input.
chrisdembia Dec 7, 2016
28a769d
Get rid of TwoFrameLinker::scale() warning on clang.
chrisdembia Dec 7, 2016
7cbcf87
Remove obsolete comment and messages [ci skip]
tkuchida Dec 7, 2016
b8c67c3
Merge branch 'master' of github.com:opensim-org/opensim-core into fix…
chrisdembia Dec 7, 2016
b6ca6b2
Fix "type mismatch" warnings from MSVC.
tkuchida Dec 7, 2016
452a08f
Merge branch 'master' of github.com:opensim-org/opensim-core into tes…
chrisdembia Dec 7, 2016
c693496
Merge branch 'master' of github.com:opensim-org/opensim-core into dox…
chrisdembia Dec 7, 2016
fa9206a
Improve docs for safeDownCast().
chrisdembia Dec 7, 2016
536cb4c
Merge pull request #1431 from opensim-org/tkuchida-fixCompilerWarnings2
aseth1 Dec 7, 2016
6a54ec6
Merge pull request #1430 from opensim-org/tkuchida-patch-1
aseth1 Dec 7, 2016
9d71b4d
Merge pull request #1416 from opensim-org/doxygen_for_declare_object_…
aymanhab Dec 7, 2016
7c6fe9f
Merge remote-tracking branch 'opensim-org/master' into test_input_wir…
chrisdembia Dec 8, 2016
5030191
Merge pull request #1429 from opensim-org/fix_TwoFrameLinker_clang_wa…
carmichaelong Dec 8, 2016
a3f2955
Merge pull request #1427 from opensim-org/test_input_wiring_exception
chrisdembia Dec 8, 2016
a236be3
Fix typos [ci skip]
tkuchida Dec 9, 2016
451cfe1
Merge pull request #1442 from opensim-org/tkuchida-patch-1
tkuchida Dec 9, 2016
416a2ad
Merge branch 'issue_845_force_isDisabled_to_appliesForce' of https://…
aseth1 Dec 12, 2016
1520096
Make updateFromXMLNode more robust by accepting multiple variations o…
aseth1 Dec 13, 2016
057d851
Update comment for 'appliesForce' property.
aseth1 Dec 13, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ matrix:
include:
- os: linux
compiler: clang
env: BTYPE=RelWithDebInfo WRAP=on DOXY=on NPROC=1 DEPLOY=no # (TEMP bintray not working) yes
env: BTYPE=RelWithDebInfo WRAP=on DOXY=on NPROC=2 DEPLOY=no # (TEMP bintray not working) yes
- os: linux
compiler: gcc
env: BTYPE=RelWithDebInfo WRAP=off DOXY=off NPROC=3 DEPLOY=no
Expand Down
4 changes: 3 additions & 1 deletion Applications/Analyze/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME analyze)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME analyze)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
3,751 changes: 1,880 additions & 1,871 deletions Applications/Analyze/test/subject01_adjusted_spring.osim

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Applications/CMC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME cmc)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME cmc)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
23 changes: 11 additions & 12 deletions Applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
# Basically, don't install the old applications on Linux or OSX, where
# they conflict with system executables like "id".
add_subdirectory(Analyze)
add_subdirectory(Forward)
add_subdirectory(Scale)
add_subdirectory(IK)
add_subdirectory(ID)
add_subdirectory(CMC)
add_subdirectory(RRA)
add_subdirectory(versionUpdate)
endif()
# If NOT OPENSIM_BUILD_INDIVIDUAL_APPS, then we will not build the old
# applications like "id". However, we still need to include those folders to
# build the tests for the tools.
add_subdirectory(Analyze)
add_subdirectory(Forward)
add_subdirectory(Scale)
add_subdirectory(IK)
add_subdirectory(ID)
add_subdirectory(CMC)
add_subdirectory(RRA)
add_subdirectory(versionUpdate)

add_subdirectory(opensim-cmd)
4 changes: 3 additions & 1 deletion Applications/Forward/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME forward)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME forward)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
4 changes: 3 additions & 1 deletion Applications/ID/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME id)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME id)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
4 changes: 3 additions & 1 deletion Applications/IK/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME ik)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME ik)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
4 changes: 3 additions & 1 deletion Applications/RRA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME rra)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME rra)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
4 changes: 3 additions & 1 deletion Applications/Scale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenSimAddApplication(NAME scale)
if(OPENSIM_BUILD_INDIVIDUAL_APPS)
OpenSimAddApplication(NAME scale)
endif()

if(BUILD_TESTING)
subdirs(test)
Expand Down
19 changes: 1 addition & 18 deletions Applications/opensim-cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,13 @@
# docopt_DIR.
find_package(docopt 0.6.1
HINTS "${OPENSIM_DEPENDENCIES_DIR}/docopt/lib/cmake/docopt")
if(WIN32)
# Back out the directory containing docopt.dll
# The docopt-config.cmake file does not define a variable containing
# the docopt installation directory.
# The location of docopt-config.cmake within the docopt installation is
# lib/cmake/docopt.
# docopt_DIR is the path to the docopt-config.cmake file.
# So we remove the last two directories from docopt_DIR.
get_filename_component(docopt_lib_dir ${docopt_DIR} PATH)
get_filename_component(docopt_lib_dir ${docopt_lib_dir} PATH)
CopyDependencyDLLsForWin(docopt ${docopt_lib_dir})
endif()

if(NOT docopt_FOUND)
message(FATAL_ERROR "Dependency 'docopt' not found, but is needed for \
command-line argument parsing; see the related CMake Warning.\
Follow the Superbuild instructions in README.md to obtain docopt.")
endif()


# We put "-cli" in the name of the executable in the build directory; the name
# "opensim" would conflict with the "OpenSim" folder in the build directory (on
# case-insensitive filesystems). However, the executable is renamed to
# "opensim" when it is installed.
OpenSimAddApplication(NAME opensim-cmd
SOURCES opensim-cmd_run-tool.h
opensim-cmd_print-xml.h
Expand All @@ -37,7 +20,7 @@ OpenSimAddApplication(NAME opensim-cmd
parse_arguments.h
)

target_link_libraries(opensim-cmd docopt)
target_link_libraries(opensim-cmd docopt_s)

if(BUILD_TESTING)
subdirs(test)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
% ----------------------------------------------------------------------- %
% The OpenSim API is a toolkit for musculoskeletal modeling and %
% simulation. See http://opensim.stanford.edu and the NOTICE file %
% for more information. OpenSim is developed at Stanford University %
% and supported by the US National Institutes of Health (U54 GM072970, %
% R24 HD065690) and by DARPA through the Warrior Web program. %
% %
% Copyright (c) 2005-2016 Stanford University and the Authors %
% Author(s): Christopher Dembia %
% %
% Licensed under the Apache License, Version 2.0 (the "License"); %
% you may not use this file except in compliance with the License. %
% You may obtain a copy of the License at %
% http://www.apache.org/licenses/LICENSE-2.0. %
% %
% Unless required by applicable law or agreed to in writing, software %
% distributed under the License is distributed on an "AS IS" BASIS, %
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or %
% implied. See the License for the specific language governing %
% permissions and limitations under the License. %
% ----------------------------------------------------------------------- %

% This example shows how to wire inputs and outputs by reporting the position
% of the system's center of mass. We also illustrate that input-output
% connections are stored in model (.osim) files.
% The model contains just one body, a free joint, and the table reporter.

import org.opensim.modeling.*;


modelFilename = 'wiring_inputs_and_outputs_with_TableReporter.osim';

%% Create and print the model to a .osim file.
% --------------------------------------------
model = Model();
model.setName('model');

% Create a body with name 'body', mass of 1 kg, center of mass at the
% origin of the body, and unit inertia (Ixx = Iyy = Izz = 1 kg-m^2).
body = Body('body', 1.0, Vec3(0), Inertia(1));

% Create a free joint (all 6 degrees of freedom) with Ground as the parent
% body and 'body' as the child body.
joint = FreeJoint('joint', model.getGround(), body);

% Add the body and joint to the model.
model.addComponent(body);
model.addComponent(joint);

% Create a TableReporter to save quantities to a file after simulating.
reporter = TableReporterVec3();
reporter.setName('reporter');
reporter.set_report_time_interval(0.1);
% Report the position of the origin of the body.
reporter.updInput().connect(body.getOutput('position'));
% For comparison, we will also get the center of mass position from the
% Model, and we can check that the two outputs are the same for our
% one-body system. The (optional) second argument is an alias for the name
% of the output; it is used as the column label in the table.
reporter.updInput().connect(model.getOutput('com_position'), 'com_pos');
% Display what input-output connections look like in XML (in .osim files).
disp('Reporter input-output connections in XML:');
disp(reporter.dump());

model.addComponent(reporter);

model.print(modelFilename);


%% Load the model file and simulate.
% ----------------------------------
deserializedModel = Model(modelFilename);
state = deserializedModel.initSystem();

% We can fetch the TableReporter from within the deserialized model.
reporter = TableReporterVec3.safeDownCast(...
deserializedModel.getComponent('reporter'));
% We can access the names of the outputs that the reporter is connected to.
disp('Outputs connected to the reporter:');
for i = 0:(reporter.getInput('inputs').getNumConnectees() - 1)
disp(reporter.getInput('inputs').getConnecteeName(i));
end

% Simulate the model.
manager = Manager(deserializedModel);
manager.setInitialTime(0);
manager.setFinalTime(1.0);
manager.integrate(state);

% Now that the simulation is done, get the table from the TableReporter and
% write it to a file.
% This returns the TimeSeriesTableVec3 that holds the history of positions.
table = reporter.getTable();
% Create a FileAdapter, which handles writing to (and reading from) .sto files.
sto = STOFileAdapterVec3();
sto.write(table, 'wiring_inputs_and_outputs_with_TableReporter.sto');
% You can open the .sto file in a text editor and see that both outputs
% (position of body's origin, and position of system mass center) are the same.

2 changes: 2 additions & 0 deletions Bindings/Java/Matlab/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ OpenSimAddMatlabTest(TugOfWar ../examples/OpenSimCreateTugOfWarModel.m)
OpenSimAddMatlabTest(ConnectorsInputsOutputs testConnectorsInputsOutputs.m)
OpenSimAddMatlabTest(AccessSubcomponents testAccessSubcomponents.m)
OpenSimAddMatlabTest(Simbody testSimbody.m)
OpenSimAddMatlabTest(wiringInputsAndOutputsWithTableReporter
../examples/wiringInputsAndOutputsWithTableReporter.m)

# Copy resources.
file(COPY "${OPENSIM_SHARED_TEST_FILES_DIR}/arm26.osim"
Expand Down
16 changes: 10 additions & 6 deletions Bindings/Java/Matlab/tests/testConnectorsInputsOutputs.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
end

% Access (and iterate through) a component's connectees as objects.
expectedNames = {'ground', 'block'};
expectedNames = {'block', 'ground'};
for i = 0:(names.size() - 1)
obj = joint.getConnectee(names.get(i)); % this is an object.
assert(strcmp(obj.getName(), expectedNames{i+1}));
Expand Down Expand Up @@ -80,7 +80,7 @@
% --------
% Access AbstractChannels.
assert(strcmp(coord.getOutput('speed').getChannel('').getPathName(), ...
'/leg/pin/pin_coord_0/speed'));
'/leg/pin/pin_coord_0|speed'));

% Access the value of a concrete Channel.
% TODO Concrete channels are not wrapped yet.
Expand All @@ -92,7 +92,7 @@
% ==========================
% Only need the abstract types in order to connect.
rep.updInput('inputs').connect(coord.getOutput('value'));
% With annotation:
% With alias:
rep.updInput('inputs').connect(coord.getOutput('speed'), 'target');
% These commands use the AbstractChannel.
rep.updInput('inputs').connect(source.getOutput('column').getChannel('c1'));
Expand All @@ -105,15 +105,19 @@

% Access (and iterate through) the AbstractInputs, using names.
names = rep.getInputNames();
expectedAnnos = {'value', 'target', 'c1', 'second_col'};
expectedAliases = {'', 'target', '', 'second_col'};
expectedLabels = {'/leg/pin/pin_coord_0|value', 'target', ...
'/leg/source|column:c1', 'second_col'};
for i = 0:(names.size() - 1)
% Actually, there is only one Input, named 'inputs'.
% We connected it to 4 channels.
numConnectees = rep.getInput(names.get(i)).getNumConnectees();
assert(numConnectees == 4);
for j = 0:(numConnectees - 1)
assert(strcmp(rep.getInput(names.get(i)).getAnnotation(j), ...
expectedAnnos{j+1}));
assert(strcmp(rep.getInput(names.get(i)).getAlias(j), ...
expectedAliases{j+1}));
assert(strcmp(rep.getInput(names.get(i)).getLabel(j), ...
expectedLabels{j+1}));
end
end

Expand Down
11 changes: 6 additions & 5 deletions Bindings/Java/OpenSimJNI/OpenSimContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ OpenSim_DECLARE_CONCRETE_OBJECT(OpenSimContext, Object);
_model->assemble(*_configState);
}
// Forces
bool isDisabled(const Force& force) const {
return force.isDisabled(*_configState);
bool appliesForce(const Force& force) const {
return force.appliesForce(*_configState);
}
void setDisabled(Force& force, bool disable) const {
force.setDisabled(*_configState, disable);
_model->getMultibodySystem().realize(*_configState, SimTK::Stage::Position);
void setAppliesForce(Force& force, bool applyForce) const {
force.setAppliesForce(*_configState, applyForce);
_model->getMultibodySystem().realize(*_configState,
SimTK::Stage::Position);
}
// Muscles
double getActivation(Muscle& act);
Expand Down
16 changes: 8 additions & 8 deletions Bindings/Java/tests/TestReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public static void test_TableReporter_1() throws java.io.IOException {

assert table.getColumnLabels().size() == 2;
assert table.getColumnLabel(0).
equals("/model/table_source/column:col1");
equals("/model/table_source|column:col1");
assert table.getColumnLabel(1).
equals("/model/table_source/column:col2");
equals("/model/table_source|column:col2");
assert table.getNumRows() == 3;
assert table.getNumColumns() == 2;
assert table.getRowAtIndex(0).get(0) == 1;
Expand All @@ -67,17 +67,17 @@ public static void test_TableReporter_1() throws java.io.IOException {
assert table.getNumColumns() == 0;
assert table.getColumnLabels().size() == 2;
assert table.getColumnLabel(0).
equals("/model/table_source/column:col1");
equals("/model/table_source|column:col1");
assert table.getColumnLabel(1).
equals("/model/table_source/column:col2");
equals("/model/table_source|column:col2");
// Make sure the table reference is still valid.
assert table.getNumRows() == 0;
assert table.getNumColumns() == 0;
assert table.getColumnLabels().size() == 2;
assert table.getColumnLabel(0).
equals("/model/table_source/column:col1");
equals("/model/table_source|column:col1");
assert table.getColumnLabel(1).
equals("/model/table_source/column:col2");
equals("/model/table_source|column:col2");

state = model.initSystem();
state.setTime(0.1);
Expand All @@ -89,9 +89,9 @@ public static void test_TableReporter_1() throws java.io.IOException {

assert table.getColumnLabels().size() == 2;
assert table.getColumnLabel(0).
equals("/model/table_source/column:col1");
equals("/model/table_source|column:col1");
assert table.getColumnLabel(1).
equals("/model/table_source/column:col2");
equals("/model/table_source|column:col2");
assert table.getNumRows() == 3;
assert table.getNumColumns() == 2;
assert table.getRowAtIndex(0).get(0) == 1;
Expand Down
4 changes: 2 additions & 2 deletions Bindings/Python/examples/build_simple_arm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@
# We want to write our simulation results to the console.
reporter = osim.ConsoleReporter()
reporter.set_report_time_interval(1.0)
reporter.updInput("inputs").connect(biceps.getOutput("fiber_force"))
reporter.updInput().connect(biceps.getOutput("fiber_force"))
elbow_coord = elbow.getCoordinate().getOutput("value")
reporter.updInput("inputs").connect(elbow_coord, "elbow_angle")
reporter.updInput().connect(elbow_coord, "elbow_angle")
arm.addComponent(reporter)

# ---------------------------------------------------------------------------
Expand Down
Loading