Code Monkey home page Code Monkey logo

cisst's People

Contributors

adeguet1 avatar adnanmunawar avatar ahundt avatar auneri avatar developerpaul123 avatar dlrdave avatar dmirota avatar futureneer avatar giwel avatar jbohren avatar joshuachuang avatar liushuya7 avatar marcinbalicki avatar minyang avatar neusman1 avatar pgriffiths avatar pkazanzides avatar pwilken3 avatar rg2 avatar rhgmn avatar simonleonard avatar vincent-hui avatar wanglong06 avatar youritan avatar zchen24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cisst's Issues

on branch devel: error thrown in mtsGenericObjectProxy::ConditionalCreate

E- File: mtsGenericObjectProxy.h Line: 640 - ConditionalCreate: argument prototype is wrong type for command "BatchReady" (expected "N13mtsStateTable10IndexRangeE", got "N13mtsStateTable10IndexRangeE")

Confused about why this is happening whenever I add a component to mtsManagerLocal... would someone be able to shed some light?

catkin_make err

Make Error at cisst/cmake/cisstInternalMacros.cmake:69 (message):
cisst_set_package_settings: value for variable INCLUDE_DIRECTORIES provided
for package cisstNetlib used by library cisstNumerical is not properly
defined
Call Stack (most recent call first):
cisst/cisstNumerical/CMakeLists.txt:33 (cisst_set_package_settings)

CMake Error at cisst/cmake/cisstInternalMacros.cmake:69 (message):
cisst_set_package_settings: value for variable LIBRARIES provided for
package cisstNetlib used by library cisstNumerical is not properly defined
Call Stack (most recent call first):
cisst/cisstNumerical/CMakeLists.txt:34 (cisst_set_package_settings)

Should the Data Generator Always be Built?

I've been working on a portfile for a cisst package to be included in vcpkg and while doing so discovered that even if CISST_BUILD_APPLICATIONS is turned off, the data generator application is still built. Is this to be expected?

The building of the cisstDataGeneretor project also initially fails when first building the cisst solution because it can't find cisstRevision.h when the build first starts. I'd suggest added a dependency via CMake between cisstDataGenerator and the cisstRevision build target so that it always completes first before trying to build cisstDataGenerator.

CMN_LOG compiler errors with Xcode 7.0

The macro CMN_LOG in cmn_Throw.h produces the following compiler error when built with Xcode 7.0:

/usr/local/include/cisstCommon/cmnThrow.h
/usr/local/include/cisstCommon/cmnThrow.h:80:9: Incompatible operand types ('int' and 'std::__1::basic_ostream<char>')
/Users/athundt/source/robonetracker/modules/grl/src/v_repExtGrlInverseKinematics/v_repExtGrlInverseKinematics.cpp:21:10: In file included from /Users/athundt/source/robonetracker/modules/grl/src/v_repExtGrlInverseKinematics/v_repExtGrlInverseKinematics.cpp:21:
/Users/athundt/source/robonetracker/modules/grl/include/grl/cisst/VrepVFController.hpp:12:10: In file included from /Users/athundt/source/robonetracker/modules/grl/include/grl/cisst/VrepVFController.hpp:12:
/usr/local/include/sawConstraintController/mtsVFController.h:22:10: In file included from /usr/local/include/sawConstraintController/mtsVFController.h:22:
/usr/local/include/cisstNumerical/nmrConstraintOptimizer.h:22:10: In file included from /usr/local/include/cisstNumerical/nmrConstraintOptimizer.h:22:
/usr/local/include/cisstVector/vctDynamicVectorTypes.h:29:10: In file included from /usr/local/include/cisstVector/vctDynamicVectorTypes.h:29:
/usr/local/include/cisstVector/vctDynamicVector.h:30:10: In file included from /usr/local/include/cisstVector/vctDynamicVector.h:30:
/usr/local/include/cisstCommon/cmnDeSerializer.h:33:10: In file included from /usr/local/include/cisstCommon/cmnDeSerializer.h:33:
/usr/local/include/cisstCommon/cmnGenericObject.h:35:10: In file included from /usr/local/include/cisstCommon/cmnGenericObject.h:35:
/usr/local/include/cisstCommon/cmnLogger.h:170:68: Expanded from macro 'CMN_LOG'

This error seems to appear for all instances of the CMN_LOG macro. In particular I believe it to be the 0 in this definition:

#define CMN_LOG(lod) \
    (!(cmnLogger::GetMask() & cmnLogger::GetMaskFunction() & lod)) ? \
    0: \
    ((cmnLODOutputMultiplexer(cmnLogger::GetMultiplexer(), lod).Ref()) << cmnLogLevelToString(lod) << " ")

cisstNumerical nmrNNLS.h not a correct implementation

cisstNumerical contains nmrNNLSSolver.h and nmrNNLS.h; presumably these are non-negative least-squares solvers. But, nmrNNLS.h appears to be unfinished -- while many of the comments are relevant to NNLS, the only LAPACK function called is dgesvd, which computes the SVD.

We should either delete this file, update it, or at least document that it is not finished and use conditional compilation (i.e., #if 0) to disable it.

cisstNumerical includes the function hfti_() which doesn't seem to be declared anywhere

In the master branch, cisstNumerical has nmrHFTISolver.h which uses the function hfti() (in line# 183) but its not defined anywhere. I followed the instructions to get the appropriate cisstNetlib library but couldn't find any declaration/definition for this function in that either.

This doesn't cause the cisst build to fail, but any program which tries to use the cisstNumerical library fails at the compile step as it wouldn't find the function definition. Greping the lib directory showed that the libcisstNetlib_hanson_haskell.a and libcisstNetlib_lawson_hanson.a had these strings (which I believe means that the function is defined in the library but is not declared in the header file)

I realized there are two ways I can fix this issue.

  1. Since I am not using the nmrHFTISolver I commented it out in the code/CMakeLists.txt directory (in cisstNumerical component)
  2. To get the function declaration, I copied gfortran-makefiles/include/cisstNetlib/lawson-hanson.h file, from the cisstNetlib repo, to the automatically downloaded cisstNetlib include/cisstNetlib/ directory. Commented out the #include "fortran-types.h" line. Included this file in include/cisstNetlib.h file.

I am not sure if these are the correct solutions to the problem, but they seem to silent the compiler from throwing the error.

I am not sure if this is the right place to report this issue. If its not, please excuse me and ignore this. If possible point me to where I should report.

Thanks.

SwapColorChannels + svlImageIO::write/read fail to swap color channels.

The following code snippet produces an incorrectly colored saved image (e.g., all blue). It should swap color channel R and B.

    std::string inputFile("testFile.bmp");
    std::string outputFile("outFile.bmp");

    svlSampleImageRGB           inputImage;
    svlSampleImageRGB           outputImage;

    int result = 0;
    result = svlImageIO::Read(inputImage, 0, inputFile, false);
    outputImage.SetSize(inputImage);

    // the following does not work when original image is bmp on mac.
    result = svlImageProcessing::SwapColorChannels(&inputImage, 0, &outputImage, 0);

    result = svlImageIO::Write(outputImage, 0, outputFile);

The input is a colored bmp file on mac OSX 10.9, cisst is compiled with opencv support.

cisstDataGenerator failed to parse mtsParameterTypes.cdg

When the time I completed the config of build option by cmake-gui, I started to make. Then a error came out:

[ 31%] Built target cisstNumerical
[ 31%] cisstDataGenerator for mtsParameterTypes
cisstDataGenerator: generating /home/frank/catkin_ws/src/build_cisst_saw/cisst/include/cisstMultiTask/mtsParameterTypes.h and /home/frank/catkin_ws/src/build_cisst_saw/cisst/cisstMultiTask/code/mtsParameterTypes_cdg.cpp from /home/frank/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/code/../mtsParameterTypes.cdg
/home/frank/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/code/../mtsParameterTyp" 
in g:3: error: unexpected keyword "
global {
  class {}
  inline-header {}
  inline-code {}
}


2: 
': '
4: 
Error, failed to parse file "/home/frank/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/code/../mtsParameterTypes.cdg"
make[2]: *** [cisst/include/cisstMultiTask/mtsParameterTypes.h] Error 255
make[1]: *** [cisst/cisstMultiTask/code/CMakeFiles/cisstMultiTask.dir/all] Error 2
make: *** [all] Error 2

image

What should I do? Please help me!

enable travis-ci for jhu-cisst/cisst

To finish the initial setup of travis-ci, an administrator for this repository must go to travis-ci.org and link the build system to this repository, so that builds are actually executed, and add an image link indicating success/failure to the readme.md so the status can be seen by users.

cisst not finding cisstnetlib on linux with linuxbrew

Detailed compilation logs can be found in the following gist-logs.

Automatic compilation script to reproduce this issue on ubuntu 14.04:

bash <(curl -fsSL https://raw.githubusercontent.com/ahundt/homebrew-robotics/master/robonetracker.sh)

Please note this will take quite some time (hours), because it sets up a brand new environment from scratch! Also note that for the right things to be found you need to add something to your .bashrc. Note that this changes your library and executable loading configuration! If you delete the line it will go back to the original configuration.

  • Linux only - add linuxbrew to /.bashrc, paste echo 'prefix=/.linuxbrew;PATH="$prefix/bin:$prefix/sbin:$PATH" # give linuxbrew priority, see https://github.com/Homebrew/linuxbrew/' >> ~/.bashrc; source ~/.bashrc into terminal.

Detailed instructions can be found via homebrew-robotics in the README.md.

I expect this issue to be another related to capitalization, incorrect configuration, or something else in the CMakeLists.txt. It is probably exactly the same as one of the prior issues found on OS X when searching for cisstnetlib.

Finding Qt5 on OS X with homebrew

I don't need this at the moment but wanted to record the issue.

I have Qt5 installed on OS X using homebrew, but the cmake configuration script failed to find it.

 Looking for Qt5: can't find Qt5Core
 Looking for Qt5: can't find Qt5Widgets
 Looking for Qt5: can't find Qt5Gui
 Looking for Qt5: can't find Qt5OpenGL
brew info Qt5
Qt5: stable 5.4.2 (bottled), HEAD
Version 5 of the Qt framework
https://www.qt.io/

This formula is keg-only.
Qt 5 conflicts Qt 4 (which is currently much more widely used).

/usr/local/Cellar/Qt5/5.4.1 (6392 files, 289M)
  Poured from bottle
/usr/local/Cellar/Qt5/5.4.2 (6319 files, 287M)
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/qt5.rb
==> Dependencies
Build: xz ✔, pkg-config ✔
Optional: d-bus ✔
==> Options
--universal
    Build a universal binary
--with-d-bus
    Build with d-bus support
--with-developer
    Build and link with developer options
--with-docs
    Build documentation
--with-examples
    Build examples
--with-mysql
    Build with mysql support
--with-oci
    Build with Oracle OCI plugin
--HEAD
    Install HEAD version
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

This formula is keg-only, which means it was not symlinked into /usr/local.

Qt 5 conflicts Qt 4 (which is currently much more widely used).

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/Qt5/lib
    CPPFLAGS: -I/usr/local/opt/Qt5/include


.app bundles were installed.
Run `brew linkapps Qt5` to symlink these to /Applications.
``

all the folders seem to be correctly present in the standard `/usr/local/include` location:

ls /usr/local/include/Qt
QtCore@ QtHelp@ QtScript@ QtTest@ QtXmlPatterns@
QtDeclarative@ QtMultimedia@ QtScriptTools@ QtUiTools@
QtDesigner@ QtNetwork@ QtSql@ QtWebKit@
QtGui@ QtOpenGL@ QtSvg@ QtXml@

Jacobian and wrench classes

It would be nice to have some basic methods to handle jacobian matrices and wrenches. Changing reference frame for example. This could go in cisstVector or cisstRobot.

CMake errors when catkin is not available

It seems some of the new changes in the cmake are causing problems when ROS is NOT available.

CMake Error at thirdparty/cisst-saw/sawConstraintController/code/CMakeLists.txt:109 (cisst_is_catkin_build):
  Unknown CMake command "cisst_is_catkin_build".

Probaby broken by this commit in sawConstraintController: 3f79d338376f3fc64b5378574829efb846f332fa

linker error - vctDoubleMat argument type in mtsCommand - mtsGenericObjectProxy undefined

//roBehaviorSinusNavControl.h:
void SetMat(const vctDoubleMat &mat) { m = mat};

//roBehaviorSinusNavControl.cpp
providedInterface->AddCommandWrite(&roBehaviorSinusNavControl::SetMat, this, "SetMat");

//linker errors:
function mtsGenericObjectProxyBase<vctDynamicMatrix<double> >::Services() const: error: undefined reference to 'mtsGenericObjectProxy<vctDynamicMatrix<double> >::ClassServices()'
function vtable for mtsGenericObjectProxy<vctDynamicMatrix<double> >: error: undefined reference to 'mtsGenericObjectProxy<vctDynamicMatrix<double> >::Services() const'


//If I change the matrix to mts then it works:
void SetMat(const mtsDoubleMat &mat) { m = mat};  

travis-ci build

I'm attempting to set up an initial basic travis-ci build, with the goal of adding additional components to compile at each step. This involves the addition of a .travis.yaml configuration file, and setup of the travis-ci build on the travis-ci.org website.

Qt use in SVL examples

I just updated cisstStereoVision (6ec2e33) to add cisstQt to the list of required cisst libraries for the cameraviewer and videoplayer examples. Without this change, it does not compile on Windows with VS 2008 and Qt 4.8.5 (64-bit) because the compiler cannot find <QApplication>.

I noticed, however, that the CMakeLists.txt initially specifies that cisstStereoVisionQt (and now cisstQt) are required, whereas later in the file it checks the CISST_HAS_QT4 setting to determine whether to link with the cisstStereoVisionQt library. This does not seem to be the best implementation. Also, what about Qt5?

Fail to build cisst with catkin build and cmake versions >= 3.11 on Ubuntu 16.04

After I had updated my cmake, when I built dVRK 1.7.1 with catkin build, I found that cisst failed to be built. I tried several cmake versions, I found that when I used cmake 3.11 or higher versions, cisst failed to be built.

Error messages

Errors     << cisst:make /mnt/ramdisk/catkin-jhu/logs_release/cisst/build.make.000.log
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:76: Error: Unable to find 'cisstMultiTask/mtsExecutionResult.h'
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:796: Error: Unable to find 'cisstMultiTask/mtsParameterTypes.h'
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:802: Error: Unable to find 'cisstMultiTask/mtsComponentState.h'
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:805: Error: Unable to find 'cisstMultiTask/mtsInterfaceCommon.h'
make[2]: *** [cisstMultiTask/codePython/cisstMultiTaskPYTHON_wrap.stamp] Error 1
make[2]: *** Deleting file 'cisstMultiTask/codePython/cisstMultiTaskPYTHON_wrap.stamp'
make[1]: *** [cisstMultiTask/codePython/CMakeFiles/gen_cisstMultiTaskPython_cisstMultiTaskPYTHON_wrap.dir/all] Error 2

vector.XYZ() * mtsDouble() compilation error

  vct5 v5a;
  vct5 v5b;
  mtsDouble d;
  v5a.XYZ() = v5b.XYZ() * d;   //fails

//error: Invalid operands to binary expression ('vctFixedSizeVectorRef<double, 3, 1L>' and 'mtsDouble' (aka 'mtsGenericObjectProxy<double>'))

 // the following works:
v5a.XYZ() = v5b.XYZ() * d.Data

cisstOSAbstraction Compiler errors on OS X

I think some incorrect or non cross platform types were used in some cisstOSAbstraction code. Errors are below.

cisstOSAbstraction Group
Semantic Issue Group
/Users/athundt/source/robonetracker/thirdparty/cisst-saw/cisst/cisstOSAbstraction/code/osaSocket.cpp:437:30: Non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list
/Users/athundt/source/robonetracker/thirdparty/cisst-saw/cisst/cisstOSAbstraction/code/osaSocket.cpp:437:30: Insert an explicit cast to silence this issue
/Users/athundt/source/robonetracker/thirdparty/cisst-saw/cisst/cisstOSAbstraction/code/osaSocket.cpp:561:34: Non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list
/Users/athundt/source/robonetracker/thirdparty/cisst-saw/cisst/cisstOSAbstraction/code/osaSocket.cpp:561:34: Insert an explicit cast to silence this issue
/Users/athundt/source/robonetracker/thirdparty/cisst-saw/cisst/cisstOSAbstraction/code/osaSocket.cpp:740:34: Non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list
/Users/athundt/source/robonetracker/thirdparty/cisst-saw/cisst/cisstOSAbstraction/code/osaSocket.cpp:740:34: Insert an explicit cast to silence this issue

Assign with ellipsis arguments leads to hard to find bugs

Using:

vctDoubleMat m(3,3);
m.Assign(1, 0, 0,
         0, 1, 0,
         0, 0, 1);

leads to garbage because the last arguments are stacked as ints and the va_arg macros expect doubles. Users have to specify 1.0 instead of 1. The simplest fix is to define for Assign methods to cover signatures with more parameters, maybe up to 16? A macro can be introduced for this. Based on feedback from @zchen24 and @marcinbalicki.

robManipulator memory leak

Here is my test code:

void test()
{
  vctDoubleVec jnt_pos(6, 0.0);
  vctFrm4x4    cpos;
  robManipulator rob("/path/to/simpsm.rob");
  cpos = rob.ForwardKinematics(jnt_pos);
}

int main()
{
  for (size_t i = 0; i < 10; i++)
  {
    test();
  }
}

Valgrind output

==17464== Memcheck, a memory error detector
==17464== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==17464== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==17464== Command: ./testrob
==17464== 
==17464== 
==17464== HEAP SUMMARY:
==17464==     in use at exit: 79,744 bytes in 41 blocks
==17464==   total heap usage: 2,426 allocs, 2,385 frees, 358,558 bytes allocated
==17464== 
==17464== LEAK SUMMARY:
==17464==    definitely lost: 1,120 bytes in 20 blocks
==17464==    indirectly lost: 5,920 bytes in 20 blocks
==17464==      possibly lost: 0 bytes in 0 blocks
==17464==    still reachable: 72,704 bytes in 1 blocks
==17464==         suppressed: 0 bytes in 0 blocks
==17464== Rerun with --leak-check=full to see details of leaked memory
==17464== 
==17464== For counts of detected and suppressed errors, rerun with: -v
==17464== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

cmnData<std::string>::SerializeText adds escape characters before spaces -- breaks some code

cmnData<std::string>::SerializeText adds an escape character, '', before any spaces in the string being serialized. This breaks code in many argument constructors because they attempt to parse multiple parameters from a single string (in the FromStreamRaw method). This is only used by the cisstComponentManager, however, so it is not a major issue. My opinion is that we should preserve any escape characters already in the string, but not add any in SerializeText. We could have a separate method (perhaps a helper function) to add escape characters to a string.

Dynamic Component Connection

Dynamic component connection is not enabled by default. Currently the following code snippet has to be called during startup in one of the components to make the reconnection work

mtsInterfaceRequired *required = EnableDynamicComponentManagement();

catkin build fails

I want to install dvrk-ros in Ubuntu. I clone the cisst-saw files and when I use catkin build, I get errors. The files fail to be cloned and i only manage to successfully install 14 out of 30 packages. This occurs with the master branch. In the devel branch, I get a different error:

error building cisst-saw devel

Does anyone have any suggestions how to overcome this problem and install the dvrk?

Thanks

Nick

mtsFrm4x4

Ran into a surprising data type mismatch issue - last line fails with "no viable overload = " on mac OS. Any thoughts?

mtsFrm4x4 goalFrm;
mtsFrm4x4 currentFrm;
mtsFrm4x4 diffFrm;
diffFrm.Translation() =  goalFrm.Translation() - currentFrm.Translation();
diffFrm.Rotation() = goalFrm.Rotation() * currentFrm.Rotation().Transpose();

The unsightly workaround is below :
diffFrm.Rotation().Assign(goalFrm.Rotation() * currentFrm.Rotation().Transpose());

cisstNumericalTests error on nmrConstraintOptimizer

Output of tests:

!!!FAILURES!!!
Test Results:
Run:  119   Failures: 1   Errors: 0


1) test: nmrConstraintOptimizerTest::TestSolve (F) line: 142 /Users/anton/devel/cisst-saw/cisst/cisstNumerical/tests/nmrConstraintOptimizerTest.cpp
equality assertion failed
- Expected: 4
- Actual  : 0

Problem with disconnecting services

When running cisst tasks within the visual studio unit testing framework, it is important to be able to startup and shutdown the system while still holding on to the same process. I see a hack in the cisst sample tests related to this that was added a number of years back:
// the manager singleton needs to be cleaned up, adeguet1
std::cerr << "temporary hack " << CMN_LOG_DETAILS << std::endl;
manager->RemoveComponent("LCM_MCC");
manager->RemoveComponent("MCS");
However, this is not the only problem I am facing. I am able to trigger a crash and/or an error on disconnect by playing with the timing. A "simple" testcase is below, which I can use to trigger a crash by inserting a delay, or trigger an error by inserting a delay in a different spot.


#include <chrono>
#include <thread>
#include <stdint.h>
#include <cisstMultiTask/mtsTaskContinuous.h>
#include <cisstMultiTask/mtsTaskPeriodic.h>
#include <cisstMultiTask/mtsInterfaceRequired.h>
#include <cisstMultiTask/mtsInterfaceProvided.h>

class Server : public mtsTaskPeriodic
{
	CMN_DECLARE_SERVICES(CMN_NO_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEBUG);
public:
	Server();
	virtual ~Server();
	void Configure(const std::string & CMN_UNUSED(filename)) {};
	void Startup(void);
	void Run(void);
	void Cleanup(void);
	int32_t data_;
};
CMN_DECLARE_SERVICES_INSTANTIATION(Server);

class Client : public mtsTaskContinuous
{
	CMN_DECLARE_SERVICES(CMN_NO_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEBUG);
public:
	Client();
	virtual ~Client();
	struct {
		mtsFunctionRead GetData;
	} _Task;
	void Configure(const std::string & CMN_UNUSED(filename)) {};
	void Startup(void);
	void Run(void);
	void Cleanup(void);
};
CMN_DECLARE_SERVICES_INSTANTIATION(Client);

CMN_IMPLEMENT_SERVICES_DERIVED(Server, mtsTaskPeriodic);
CMN_IMPLEMENT_SERVICES_DERIVED(Client, mtsTaskContinuous);

Server::Server()
	: mtsTaskPeriodic("server", 0.005, false)
{
	StateTable.AddData(data_, "stab");
	mtsInterfaceProvided *addI = this->AddInterfaceProvided("pi");
	addI->AddCommandReadState(StateTable, data_, "c1");
}
Server::~Server()
{
}
void Server::Startup()
{
	data_ = 0;
}
void Server::Cleanup()
{
}
void Server::Run()
{
	ProcessQueuedCommands();
	ProcessQueuedEvents();
	data_++;
	Sleep(0.002);
}

Client::Client()
	: mtsTaskContinuous("client")
{
	mtsInterfaceRequired *addI = AddInterfaceRequired("ri");
	addI->AddFunction("c1", _Task.GetData);
}
Client::~Client()
{
}
void Client::Startup()
{
}
void Client::Cleanup()
{
}
void Client::Run()
{
	ProcessQueuedCommands();
	ProcessQueuedEvents();
	Sleep(0.002);
}


int  main(int argc, char **argv)
{
	std::cout << "starting" << std::endl;
	cmnLogger::SetMaskDefaultLog(CMN_LOG_ALLOW_ALL);

	Server *svr = new Server();
	Client *cli = new Client();

	mtsManagerLocal *taskManager = mtsManagerLocal::GetInstance();

	std::chrono::milliseconds dur(2000);

	taskManager->AddComponent(svr);
	taskManager->AddComponent(cli);

	taskManager->Connect(cli->GetName(), "ri", svr->GetName(), "pi");
	cli->_Task.GetData.IsValid();

	taskManager->CreateAll();
	taskManager->WaitForStateAll(mtsComponentState::READY, 2.0 * cmn_s);

	taskManager->StartAll();
	taskManager->WaitForStateAll(mtsComponentState::ACTIVE, 4.0 * cmn_s);

	// If this delay is removed, the first GetData returns garbage
	//std::this_thread::sleep_for(std::chrono::milliseconds(10));

	int32_t data = -1;
	std::cout << "data " << std::to_string(data) << std::endl;
	cli->_Task.GetData(data);
	std::cout << "data " << std::to_string(data) << std::endl;
	std::this_thread::sleep_for(dur);
	cli->_Task.GetData(data);
	std::cout << "data " << std::to_string(data) << std::endl;
	std::this_thread::sleep_for(dur);
	cli->_Task.GetData(data);
	std::cout << "data " << std::to_string(data) << std::endl;

	taskManager->KillAll();
	taskManager->WaitForStateAll(mtsComponentState::FINISHED, 2.0 * cmn_s);

	std::cout << "disconnecting" << std::endl;
	taskManager->Disconnect(cli->GetName(), "ri", svr->GetName(), "pi");
	std::cout << "finished disconnect call" << std::endl;

	// If this delay is added a crash happens within mtsManagerComponentClient::DisconnectLocally (when ultimately calling mtsMailBox::Write)
	std::this_thread::sleep_for(dur);
	std::cout << "finished sleep after disconnect" << std::endl;

	taskManager->RemoveComponent(cli);
	taskManager->RemoveComponent(svr);
	// If this delay is added (and the previous one removed to avoid the crash), cisst errors are logged regarding disconnect issues
	std::this_thread::sleep_for(dur);
	std::cout << "finished sleep after remove components" << std::endl;

	delete cli;
	delete svr;
	std::cout << "exiting" << std::endl;
}

cisst branch cmake fails

CMaking of cisst branch fails due to missing license.txt file:

Configuring cisst 1.0 from "/Users/MJ/project/fault/cisst", revision: undefined

CMake Error at /opt/local/share/cmake-2.8/Modules/CPack.cmake:395 (message):
    CPack license resource file: "/license.txt" could not be found.
Call Stack (most recent call first):
    /opt/local/share/cmake-2.8/Modules/CPack.cmake:400 (cpack_check_file_exists)
    CMakeLists.txt:526 (include)

The master doesn't have this issue. This seems to be different locations of license.txt file between master and branches. Different folder structures between master and branch -- master has each library at the top, whereas all branches have those libraries under 'cisst' folder -- may be causing this issue.

Support C++17 ISO Standard

Building cisst fails when the C++17 standard is specified (i.e. /std:c++17 for Visual Studio). This is due to the use of some functions/constructs in the standard template library that were removed in C++17 (std::binary_function for example).

cisst build fails on feature-cxx-compatibility branch

I tried to build the latest cisst on feature-cxx-compatibility branch with catkin on Ubuntu 16.04 with gcc 5.4
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14
but cisst build fails. The error mesage is
src/cisst-saw/cisst/cisstCommon/cmnPortability.h:395:33: error: ‘isnan’ was not declared in this scope #define CMN_ISNAN(x) isnan(x)
because CISST_USE_STD_ISNAN, CISST_USE_STD_ISFINITE and CISST_USE_CMATH are not defined. The definitions of CISST_USE_STD_ISNAN, CISST_USE_STD_ISFINITE and CISST_USE_CMATH are removed by this commit

In order to build dvrk-ros with C++ 14 standard on Ubuntu 16.04 with gcc 5.4, we need to

  1. include instead of <math.h>
  2. use std::isnan instead of isnan
  3. use std::isfinite instead of isfinite

undefined references in cisstMultiTask

Fresh clone and build with CISST_HAS_JSON

libcisstMultiTask.so: undefined reference to cmnDataJSON<unsigned long>::SerializeText(unsigned long const&, Json::Value&)' libcisstMultiTask.so: undefined reference tocmnDataJSON::DeSerializeText(unsigned long&, Json::Value const&)'

Git workflow for SAW components is not documented

I understand that the master branch is stable, whereas the devel branch is used for normal commits, but what is the convention for updating the master? i.e., who is responsible for merging, is there a schedule to it, is it tied to release tags, etc..

Could not find any help on wiki, under development guidelines.

Support building via add_subdirectory()

Consider the following CMakeLists.txt

cmake_minimum_required(3.0)
project(MyProject)

add_subdirectory(cisstNetlib)
add_subdirectory(cisst-saw)

include_directories(CISSTNETLIB_INCLUDE_DIRS)
add_library(mylib mylib.cpp)
target_link_libraries(mylib ${CISSTNETLIB_LIBRARIES} ${CISST_SAW_LIBRARIES)

This seems like a very reasonable way to structure a build, but right now it doesn't work.
I would appreciate if support for this build style could be added to cisst, cisst-saw, and cisstNetlib.

Currently the following must be added to get partial support working, in this case the files are in a thirdparty subdirectory:

set(CISSTNETLIB_FOUND TRUE)

set(CISSTNETLIB_INCLUDE_DIRS
    ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cisstNetlib/include
    ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/cisstNetlib/include
)

set(CISSTNETLIB_INCLUDE_DIR ${CISSTNETLIB_INCLUDE_DIRS}) #hack to deal with this variable being used in cisstNumerical

set(CISSTNETLIB_LIBRARIES
    cisstNetlib
    cisstNetlib_hanson_haskell
    cisstNetlib_lawson_hanson
    #cisstNetlib_lapack
    #cisstNetlib_blas
    #cisstNetlib_f2c
)

set(CISST_SAW_FOUND TRUE)
set(CISST_SAW_INCLUDE_DIRS 
  #binary
  ${CMAKE_CURRENT_BINARY_DIR}/thirdparty/cisst-saw/cisst/include
  ${CISST_SAW_PLATFORM_SPECIFIC_INCLUDES}
  #source
  ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cisst-saw/cisst
  ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cisst-saw/sawConstraintController/include
)

set(CISST_SAW_LIBRARIES
    sawConstraintController
    cisstCommon
    cisstNumerical
    cisstMultiTask
)

The appropriate variables and configuration should be set completely and correctly even when being built as a subdirectory of a parent build directory for maximum reusability and ease of use.

cisst cmake configuration not detecting installed cisstNetlib

I've installed cisstNetlib on my OS (c version) installed in /usr/local, and currently the cmake script is failing to find the installed version. Detailed logs can be found here

CMake Command

==> cmake . -DCMAKE_C_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/cisst/HEAD -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCISST_BUILD_EXAMPLES=OFF -DCISST_BUILD_SHARED_LIBS=OFF -DCISST_BUILD_TESTS=OFF -DCISST_HAS_CISSTNETLIB=ON -DCISST_HAS_IOS=OFF -DCISST_HAS_JSON=OFF -DCISST_HAS_QT4=OFF -DCISST_MTS_HAS_ICE=OFF -DCISST_USE_EXTERNAL=OFF -DCISST_XML_LIB=LibXml2 -DCISST_cisst3DUserInterface=OFF -DCISST_cisstCommon=ON -DCISST_cisstCommonXML=ON -DCISST_cisstInteractive=OFF -DCISST_cisstMultiTask=ON -DCISST_cisstNumerical=ON -DCISST_cisstOSAbstraction=ON -DCISST_cisstParameterTypes=ON -DCISST_cisstRobot=ON -DCISST_cisstStereoVision=OFF -DCISST_cisstVector=ON -DCMAKE_BUILD_TYPE=Debug

Key Error Lines

-- Found Threads: TRUE
CMake Error at cmake/cisstInternalMacros.cmake:69 (message):
  cisst_set_package_settings: value for variable LIBRARIES provided for
  package cisstNetlib used by library cisstNumerical is not properly defined
Call Stack (most recent call first):
  cisstNumerical/CMakeLists.txt:25 (cisst_set_package_settings)


Information: all libraries and settings have been found for /tmp/cisst20150928-40995-kxbqv9/cisstMultiTask/applications/cisstComponentManager, it is possible cisst-config.cmake has not been found yet,  make sure the CMake configuration is complete first.
Information: all libraries and settings have been found for /tmp/cisst20150928-40995-kxbqv9/cisstMultiTask/applications/cisstLogger, it is possible cisst-config.cmake has not been found yet,  make sure the CMake configuration is complete first.
Information: code in /tmp/cisst20150928-40995-kxbqv9/cisstRobot/applications/cisstRandomJoints will not be compiled, it requires cisstCommon;cisstVector;cisstOSAbstraction;cisstRobot;cisstNumerical
Information: code in /tmp/cisst20150928-40995-kxbqv9/cisstRobot/applications/cisstForwardKinematics will not be compiled, it requires cisstCommon;cisstVector;cisstOSAbstraction;cisstRobot;cisstNumerical
Information: code in /tmp/cisst20150928-40995-kxbqv9/cisstRobot/applications/cisstKinematicsIdentification will not be compiled, it requires cisstCommon;cisstVector;cisstOSAbstraction;cisstRobot;cisstNumerical
Information: code in /tmp/cisst20150928-40995-kxbqv9/cisstRobot/applications/cisstRobotSensorCalibration will not be compiled, it requires cisstCommon;cisstVector;cisstOSAbstraction;cisstRobot;cisstNumerical
-- Configuring incomplete, errors occurred!

Steps to Repeat on OS X

  1. Install homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Add homebrew-science brew tap homebrew/science
  3. Add homebrew-robotics brew tap ahundt/robotics
  4. Install cisstnetlib brew install --HEAD --cc=clang --build-from-source --with-debug -vd --HEAD cisstnetlib
  5. Attempt to install cisst brew install --HEAD --cc=clang --build-from-source --with-debug -vd --HEAD cisst

cisstVector Build Fails WhenUsing ClangCl with MSVC 2019

When building cisst with ClangCl in MSVC 2019, the cisstVector build fails with the following error:

E:\Repositories\cisst\cisst-src\cisstVector/vctEulerRotation3.h(384,1): Error:  explicit instantiation of undefined function template 'vctEulerFromMatrixRotation3'
2> expanded from macro 'VCT_DECLARE_EULER_CONVERSION_TEMPLATES'
2> explicit instantiation refers here
2> expanded from macro 'VCT_DECLARE_EULER_CONVERSIONS'

The error is repeated multiple times. I can post the full error output if needed.

It seems that this is due to a mis-identification of MSVC as the compiler since clang-cl is meant to be a drop in replacement for cl.

See here for more info on using clang with MSVC 2019.

Unnecessary rebuilds after git describe was added

In 639ee10, we added some code to generate a readable revision info using git describe. The file generated is then included by many parts of cisst/SAW and this leads to tons of re-compilations and re-links.

A first fixed was checked-in in 3ae04a1, i.e. the file cisstRevision.h is now re-generated only when git revision changes, not every time CMake runs.

There is still an issue with the cisstDataGenerator. i.e. the code is generated overtime the git revision changes and has to be recompiled even if the generated code hasn't changed. One simple fix is to generated the code in temporary files and push it to the build tree only if it's different from the existing one (maybe using the CMake -E copy_if_different in the cisstMacro.cmake).

Compiling with OpenCV3

I'm trying to compile and integrate cisst and my toolset utilizes opencv3. I ran into an issue because it seems cisst utilized some headers that have been deprecated in opencv2 for several years and finally retired in opencv3.

As a start any of the headers in opencv2/legacy have been retired and no longer exist.
In particular the first batch of these headers are included in svlTypes.h. There are probably additional instances in other files.

Additionally, opencv2/contrib has been moved to a separate repository opencv_contrib that must be compiled alongside opencv.

In file included from /Users/athundt/source/cisst/cisstStereoVision/svlBufferImage.h:27:
/Users/athundt/source/cisst/cisstStereoVision/svlTypes.h:61:14: fatal error:
      'opencv2/contrib/contrib.hpp' file not found
    #include <opencv2/contrib/contrib.hpp>

Any help would be very much appreciated!

cmnLogger issue in conditional statement

The following code does not produce the expected result:

if (condition)
   CMN_LOG_RUN_VERBOSE << "Some text" << std::endl;
else {
   // some more code
}

This appears to be due to the macro used to define CMN_LOG (note that CMN_LOG_RUN_VERBOSE just calls CMN_LOG with a specified lod):

 #define CMN_LOG(lod) \
  if (cmnLogger::GetMask() & cmnLogger::GetMaskFunction() & lod) \
    ((cmnLODOutputMultiplexer(cmnLogger::GetMultiplexer(), lod).Ref()) << cmnLogLevelToString(lod) << " ")

Simplifying the above, CMN_LOG(lod) essentially expands to the following:

if (filterTrue)
   cmnLODOutputMultiplexerRef << user_string << " "

Thus, the original code is compiled as follows, where the else is indented to better indicate the problem:

if (condition)
   if (filterTrue)
       cmnLODOutputMultiplexerRef << "Some text" << " " << std::endl;
   else {
      // some more code
   }

I believe the fix would be to put braces around the entire CMN_LOG macro, e.g.:

 #define CMN_LOG(lod) \
  { if (cmnLogger::GetMask() & cmnLogger::GetMaskFunction() & lod) \
    ((cmnLODOutputMultiplexer(cmnLogger::GetMultiplexer(), lod).Ref()) << cmnLogLevelToString(lod) << " ") }

mtsComponentManager::Connect() returns true even when interfaces fail to connect.

Hi,

I'm seeing some unexpected behavior using v1.0.6 on Ubuntu 14.04. When running the return value for mtsComponentManager::Connect() appears to be returning TRUE even when the interfaces were not successfully connected. In the code below, I expect the printed value ret to be 0, but I'm seeing 1.

#include <cisstMultiTask/mtsTaskManager.h>

int main ( int argc, char *argv[] )
{

    cmnLogger::SetMask ( CMN_LOG_ALLOW_DEFAULT );
    cmnLogger::SetMaskClassAll ( CMN_LOG_ALLOW_DEFAULT );
    cmnLogger::SetMaskFunction ( CMN_LOG_ALLOW_DEFAULT );
    cmnLogger::SetMaskDefaultLog ( CMN_LOG_ALLOW_DEFAULT );
    cmnLogger::AddChannel ( std::cout, CMN_LOG_ALLOW_DEFAULT );

    // Component manager
    mtsComponentManager *taskManager = mtsComponentManager::GetInstance();

    bool ret = taskManager->Connect ( "", "", "", "" );
    std::cout << "***" << ret << "***" << std::endl;

    return 0;
}

cmnPrintf.h no viable conversion from returned value of type 'std::ostream' on mac

In file included from ~/dev/src/cisst-saw/sawATIForceSensor/examples/mainSimulator.cpp:23:
In file included from ~/dev/build/cisst-saw-x/cisst/include/cisstCommon.h:45:
~/dev/src/cisst-saw/cisst/cisstCommon/cmnPrintf.h:315:16: error: no viable conversion from returned value of type 'std::ostream' (aka 'basic_ostream<char>') to function return type 'bool'
        return OutputStream;
               ^~~~~~~~~~~~

The cmake macro CISST_OSTREAM_CAN_CAST_TO_INT to 1

Setup:
latest devel branch on Mac OS Sierra

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.5.0

Not sure why this is happening but here is a workaround:

** One fix:**

remove : #include <cisstCommon.h> from sawATIForceSensor/examples/mainSimulator.cpp:23
change #include <cisstCommon.h> to #include <cisstCommon/cmnUnits.h> in sawATIForceSensor/sawATINetFTSimulatorQtWidget.cpp:23

catkin build /usr/bin/ld: cannot find -lReflexxesTypeII under ROS Kinetic

I'm attempting to build cisst-saw with catkin build in a fresh catkin workspace. I tried both master and devel branch and they produce the same error. reverting cisst submodule to 1.0.8 tag produces a different dependency error.

ROS Kinetic, Ubuntu 16.04

Building with ROS Indigo and Ubuntu 14.04 works.

Errors     << cisst:make /home/cos/pmd-dvrk/logs_release/cisst/build.make.001.log                                                     
/usr/bin/ld: cannot find -lReflexxesTypeII
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cos/pmd-dvrk/devel_release/.private/cisst/bin/cisstRandomJoints] Error 1
make[1]: *** [cisstRobot/applications/cisstRandomJoints/CMakeFiles/cisstRandomJoints.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lReflexxesTypeII
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cos/pmd-dvrk/devel_release/.private/cisst/bin/cisstForwardKinematics] Error 1
make[1]: *** [cisstRobot/applications/cisstForwardKinematics/CMakeFiles/cisstForwardKinematics.dir/all] Error 2
/usr/bin/ld: cannot find -lReflexxesTypeII
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cos/pmd-dvrk/devel_release/.private/cisst/bin/cisstKinematicsIdentification] Error 1
make[1]: *** [cisstRobot/applications/cisstKinematicsIdentification/CMakeFiles/cisstKinematicsIdentification.dir/all] Error 2
/usr/bin/ld: cannot find -lReflexxesTypeII
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cos/pmd-dvrk/devel_release/.private/cisst/bin/cisstRobotSensorCalibration] Error 1
make[1]: *** [cisstRobot/applications/cisstRobotSensorCalibration/CMakeFiles/cisstRobotSensorCalibration.dir/all] Error 2
make: *** [all] Error 2
cd /home/cos/pmd-dvrk/build_release/cisst; catkin build --get-env cisst | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -

Any help will be appreciated.

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.