Giter Site home page Giter Site logo

libnifalcon / libnifalcon Goto Github PK

View Code? Open in Web Editor NEW
65.0 65.0 37.0 10.15 MB

Open source drivers for the Novint Falcon haptic controller

Home Page: http://qdot.github.com/libnifalcon/

C 3.61% C++ 90.36% Java 0.41% Python 0.79% CMake 4.68% Ruby 0.05% Tcl 0.10%

libnifalcon's Introduction

libnifalcon

Description

libnifalcon is a development library for the NovInt Falcon, and is an open source, crossplatform alternative to NovInt’s SDK.

libnifalcon provides basic functionality to connect to the falcon and load firmware to the internal microcontroller. In addition, it comes with sample functionality made available through the firmware available in NovInt’s drivers (the novint.bin file in TestUtilties and the nifalcon_test_fw files for the library source). This firmware is distributed in the firmware directory of the source distribution, and is required for the findfalcons utility to run.

Compilation directions are included in the COMPILE.txt file

libnifalcon is now a supported device in the H3D Haptics Framework. More information on this is available at

Novint Falcon Information

More information about the Novint Falcon can be found at

Technical information, including protocol and hardware information, is available at the libnifalcon website

Library Requirements

ftd2xx versus libusb 1.0

libnifalcon can use two different libraries to access the falcon:

FTD2XX - Library distributed by FTDI themselves * Windows: OK - RECOMMENDED * Linux: Untested * OS X: Untested

libusb-1.0 (use whatever the latest version is. As of this writing, 1.0.2): * Windows: Not Available for Windows * Linux: OK - RECOMMENDED * OS X: OK - RECOMMENDED

Note that libnifalcon has been written in such a way that which comm library you use should have little effect on the cross-platform performance of your code. However, this is more of a hope than a promise.

What Comes With libnifalcon

With libnifalcon, you get

  • libnifalcon

    • Provides device access to the falcon

  • libnifalcon_cli_base

    • Provides base class for small test applications for the falcon

  • libnifalcon_thread

    • Provides example of threaded device support for the falcon

  • Example Programs (all require libnifalcon, plus other libraries as specified)

    • findfalcons - Prints out the number of falcon devices connected, opens each of them (one at a time), runs simple test (changes LED color, runs a few thousand I/O loops). Good for making sure things just work.

    • findfalcons_multi - Same as findfalcons, but all falcons at once. For testing multiple communications/devices.

    • barrow_mechanics - Alastair Barrow’s original implementation of the RL Stamper kinematics system used in the libnifalcon kinematics core

    • falcon_led (requires libnifalcon_cli_base) - Simple example application for extending FalconCLIBase class.

    • falcon_mouse (requires libnifalcon_cli_base) - Lets the falcon position control the mouse cursor

    • falcon_test_cli (requires libnifalcon_cli_base) - Suite of test scenes for the falcon (cube, walls, timing tests, etc…​)

  • SWIG bindings (requires SWIG and whatever language bindings you want to use)

    • FalconBridge proxy class for accessing the falcon from other languages. Tested with Java and Python so far.

Platform Specifics

Windows

  • If you are using the falcon on Windows, even if it’s a Windows VM, make sure it’s plugged in directly to a port on the machine you’re on. Hubs don’t work with the falcon on Windows.

  • NovInt uses the stock ftd2xx drivers, and it is recommended to use a ftd2xx version of libnifalcon on windows. If you have installed the drivers from NovInt’s website, access through libnifalcon should "just work".

  • Building under Visual Studio will only work for STATIC libraries, as I’m too lazy to add the declspec calls.

Linux

  • If you are using the falcon on Linux with an older kernel (pre-v3.14, though earlier may work), make sure it’s plugged in through a powered USB hub. For some reason, plugging it directly into a Linux Box causes it to work erractically.

  • Programs built with libnifalcon (including example programs that come with the library) requires either root access (i.e. running under sudo) or correct udev based USB permissions to run as non-root. There’s a sample udev file in the "linux" directory of the distribution that can help.

OS X

  • If you are using the falcon on OS X, make sure it’s plugged in through a powered USB hub. For some reason, plugging it directly into a Mac causes it to work erractically.

Credits

libnifalcon is developed and maintained and generally the fault of Kyle Machulis. More information on Kyle can be found at Nonpolynomial Labs - http://www.nonpolynomial.com

Kinematics development by Kevin Ouellet and Alastair Barrow

Contributions by * Jared Allen * Alastair Barrow * Niall Begley * Edgar Berdahl * Christian Frisson * Axel Kohlmeyer * Steven Martin * Kevin Ouellet * Devanshi Shah * Stephen Sinclair

Licenses

(License text for all following licenses is available in the license directory)

libnifalcon is licensed under the BSD license, with the following copyrights:

libnifalcon is Copyright 2007-2016 The libnifalcon Project

libnifalcon Kinematics Core is Copyright 2007-2008 Kevin Ouellet, 2009 Alastair Barrow, 2007-2016 The libnifalcon Project

libnifalcon uses GMTL, part of GGT, which is licensed under LGPL 3.0 with header exception.

GGT: The Generic Graphics Toolkit
Copyright (C) 2001,2002 Allen Bierbaum

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

On some platforms, libnifalcon uses libusb-1.0, which is licensed under LGPL 2.1.

libusb 1.0
Copyright (C) 2007-2008 Daniel Drake <[email protected]>
Copyright (c) 2001 Johannes Erdfelt <[email protected]>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

libnifalcon's People

Contributors

agirault avatar christianfrisson avatar mrsbeanbag avatar nia11 avatar qdot avatar radarsat1 avatar rpavlik 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  avatar  avatar  avatar  avatar  avatar

Watchers

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

libnifalcon's Issues

Install libnifalcon.pc file even if pkg-config executable doesn't exist

On UNIX systems, CMakeLists.txt looks for the pkg-config executable and only if it is found does it generate and install the libnifalcon.pc file. As far as I can tell you never use the pkg-config executable so there is no need to check for its existence. Just always generate and install libnifalcon.pc on UNIX.

Boost error

Hi! After install everything OK i got this issue when i run: sudo falcon_led

Loading firmware
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::bad_any_cast >'
what(): boost::bad_any_cast: failed conversion using boost::any_cast

Somebody please help me. Thanks!

libnifalcon.pc appears to be outdated

So I followed the instructions on the GitHub for an in source build. I'm currently on Ubuntu 19.10.

Here's my build process

cd libnifalcon
mkdir build
cmake ..
make -j10
sudo make install

CMake gives the following output.

-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Installation Prefix: /usr/local
-- Building Static Libraries for LIBNIFALCON
-- Building Shared Libraries for LIBNIFALCON
-- NOT using gprof output for LIBNIFALCON
-- Found libusb-1.0:
--  - Includes: /usr/include
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/emdash00/Apps/git-apps/libnifalcon/build

Sure enough after an install pkg-config yields this return

pkg-config --libs libnifalcon

-L/usr/local/lib -llibnifalcon -lnifalcon_comm_libusb -lusb-1.0

However if you try to link with this...

g++ findfalcons.cpp $(pkg-config --libs libnifalcon)

/usr/bin/ld: cannot find -llibnifalcon
/usr/bin/ld: cannot find -lnifalcon_comm_libusb
collect2: error: ld returned 1 exit status

However linking like this

g++ findfalcons.cpp -lnifalcon 

works and lets me access the Novint Falcon just fine.

Found this out when looking towards H3D's compatibility with libnifalcon. Their CMake build process still looks for nifalcon_comm_libusb. Best way to fix this would probably be a PR on their end to fix their build process and a PR on your end to fix libnifalcon.pc if the problem is what I suspect.

Though, I'm still a student and still learning about some of this stuff, so feel free let me know if I have the wrong idea or I'm just doing something wrong in my build process.

Compiling

I tried compiling the project, but I still constantly get undefined references errors. What are the linker/Include directories that I need to pass to g++ specifically? I tried -lnifalcon which did not work. The library installed to /usr/local/include/fal ...

Waiting for CTS line to go high may improve firmware download stability

From email from Jason Ekstrand:

[...] between the "Firmware Reset" stage and the "Firmware Upload", right after you set the baudrate to 140000, the falcon sets the CTS line high. I don't know how critical it is, but it seems that waiting for a raise in CTS may keep you from writing too early and make firmware upload more reliable.

Boost Library always linked statically

When compiling libnifalcon on Windows, CMake specifies the static libraries for Boost in both the SHARED link options as well as the STATIC link options.
I can provide the CMake output & a grep output showing the relevant lines from the resulting build files.

fatal error: falcon/core/FalconDevice.h: No such file or directory

Hi,
Ubuntu 14.04 ROS indigo
I follow the readme instrutions and when I install ros_falcon I got the following errors. Can you please help?

[ 97%] [ 97%] Building CXX object ros_falcon/CMakeFiles/falcon_control.dir/src/falcon_control.cpp.o
[ 98%] [ 98%] Building CXX object ros_falcon/CMakeFiles/falcon_cs_pid.dir/src/falcon_cs_pid.cpp.o
[ 98%] [ 98%] Building CXX object ros_falcon/CMakeFiles/joystick.dir/src/joystick.cpp.o
Built target ros_falcon_generate_messages
Building CXX object ros_falcon/CMakeFiles/falcon_js_pid.dir/src/falcon_js_pid.cpp.o
Building CXX object ros_falcon/CMakeFiles/driver.dir/src/driver.cpp.o
[100%] Building CXX object ros_falcon/CMakeFiles/gripper.dir/src/gripper.cpp.o
/home/ted/catkin_ws/src/ros_falcon/src/joystick.cpp:19:38: fatal error: falcon/core/FalconDevice.h: No such file or directory
#include "falcon/core/FalconDevice.h"
^
compilation terminated.
/home/ted/catkin_ws/src/ros_falcon/src/falcon_cs_pid.cpp:10:38: fatal error: falcon/core/FalconDevice.h: No such file or directory
#include "falcon/core/FalconDevice.h"
^
compilation terminated.
/home/ted/catkin_ws/src/ros_falcon/src/falcon_js_pid.cpp:10:38: fatal error: falcon/core/FalconDevice.h: No such file or directory
#include "falcon/core/FalconDevice.h"
^
compilation terminated.
/home/ted/catkin_ws/src/ros_falcon/src/driver.cpp:16:38: fatal error: falcon/core/FalconDevice.h: No such file or directory
#include "falcon/core/FalconDevice.h"
^
compilation terminated.
Linking CXX executable /home/ted/catkin_ws/devel/lib/ros_falcon/gripper
[100%] Built target gripper
Linking CXX executable /home/ted/catkin_ws/devel/lib/ros_falcon/falcon_control
[100%] Built target falcon_control
make[2]: *** [ros_falcon/CMakeFiles/driver.dir/src/driver.cpp.o] Error 1
make[1]: *** [ros_falcon/CMakeFiles/driver.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [ros_falcon/CMakeFiles/falcon_cs_pid.dir/src/falcon_cs_pid.cpp.o] Error 1
make[1]: *** [ros_falcon/CMakeFiles/falcon_cs_pid.dir/all] Error 2
make[2]: *** [ros_falcon/CMakeFiles/joystick.dir/src/joystick.cpp.o] Error 1
make[1]: *** [ros_falcon/CMakeFiles/joystick.dir/all] Error 2
make[2]: *** [ros_falcon/CMakeFiles/falcon_js_pid.dir/src/falcon_js_pid.cpp.o] Error 1
make[1]: *** [ros_falcon/CMakeFiles/falcon_js_pid.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
ted@vra1:~/catkin_ws$

Unusual homing check

I dipped into the code for homing status after some unusual behaviour when homing the falcon. I noticed that the function to check that all encoders are homed is possibly incorrect.

FalconFirmware.h:189
bool isHomed() { return ( (m_homingStatus & (ENCODER_1_HOMED | ENCODER_2_HOMED | ENCODER_3_HOMED)) > 0); }

If I'm reading that correctly, the result of (m_homingStatus & (ENCODER_1_HOMED | ENCODER_2_HOMED | ENCODER_3_HOMED)) could be any combination of ENCODER_1_HOMED, ENCODER_2_HOMED, or ENCODER_3_HOMED, and would still be > 0. The only way the check would fail is if all 3 encoders are not homed.

I assume a correct check would look something like
bool isHomed() { return ( (m_homingStatus & (ENCODER_1_HOMED | ENCODER_2_HOMED | ENCODER_3_HOMED)) == (ENCODER_1_HOMED | ENCODER_2_HOMED | ENCODER_3_HOMED)); }

Falcon Firmware

So I am now at the point where I am looking for the falcon but without firmware to load, where is the firmware supposed to come from and where should it be put?

The docs say "firmware available in NovInt’s drivers (the novint.bin file in TestUtilties and the nifalcon_test_fw files for the library source). This firmware is distributed in the firmware directory of the source distribution, and is required for the findfalcons utility to run.", but I seem unable to locate this and where would I put it?

Please note I have Osx so can't extract Novint's drivers!

Falcons found: 1
Opening falcon 1
Opened falcon
Loading firmware
Could not load firmware

Positive forces generated incorrectly

When using the x-wall and y-wall tests, forcing the effector into the area behind the barrier region causes different events depending on the sign of the force the barrier region is producing. For instance, if using the x-wall test, pushing the effector into the barrier region when it is to the right (positive direction on the x-axis), the force output of the barrier region is to the left (negative direction on the x-axis), and the program produces the expected result, that no matter where the effector is in the barrier region, it feels like it is being pushed back toward the left. When this situation is reversed, and the end effector is being pushed toward the left (negative), the barrier region seems to react with some correct force (positive) while the effector is near the barrier region border. If the effector is pushed farther into the region, the forces seem very wrong, actually pulling the effector farther in.

The force calculation for each barrier region with the wall test is the same, the signs just end up being switched depending on which direction you're going. This bug exists somewhere in the calculation of the joint forces based on the cartesian forces, most likely jacobian calculation.

Create a new version of libnifalcon in a modern language

Most people are only interested in using libnifalcon via the original firmware, and until the firmware is reversed, that's all that is usable. Therefore, there should be a simple C library to use instead of the C++ framework.

libnifalcon actually started as a C API, so this shouldn't be too difficult.

Falcon not found [Windows 10]

Hello there,

I'm trying to make the Falcon work with libnifalcon on Windows 10.
Like the README advised to do, I installed Boost (version 1.69) and FtD2xx.
The compilation on Cmake and the generation of the solution for Visual Studio worked, and building the solution as well.
I plug the Falcon and when I launch the findfalcon.exe, I get this on the console:

Falcons found: -1
Opening falcon 1
Cannot open falcon - Error:

Is there another thing I have to do before running the executable?

Thank s in advance!

Errors making

So, have been trying to get this to build on my Mac OSX 10.7 for a while :-)

I have extracted boost and added BOOST_INCLUDE_DIR to /usr/local/boost_1_48_0
Although Boost_dir is empty...

I still get the message Could NOT find Boost, but usually I get lots of red errors if the include dir is empty...

Anyway when I come to make:

$ cmake -G "Unix Makefiles" ..
-- Using compily_buildd git submodule /Users/pezcuckow/Novint/libnifalcon/compily_buildd/cmake
-- Installation Prefix: /usr/local
-- Building Static Libraries for LIBNIFALCON
-- Building Shared Libraries for LIBNIFALCON
-- NOT using gprof output for LIBNIFALCON
-- Found libusb-1.0:
-- - Includes: /usr/local/include
-- - Libraries: /usr/local/lib/libusb-1.0.dylib
-- Could NOT find Boost
Cannot compile falcon_led - Missing Boost Program Options
Cannot compile falcon_test_cli - Missing Boost Program Options
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pezcuckow/Novint/libnifalcon/build
$ make
[ 33%] Built target nifalcon_SHARED
[ 66%] Built target nifalcon_STATIC
[ 66%] Built target nifalcon_DEPEND
[ 73%] Built target barrow_mechanics
Linking CXX executable ../bin/falcon_mouse
Undefined symbols for architecture x86_64:
"vtable for boost::program_options::variables_map", referenced from:
boost::program_options::variables_map::~variables_map()in falcon_mouse.cpp.o
"vtable for libnifalcon::FalconCLIBase", referenced from:
libnifalcon::FalconCLIBase::~FalconCLIBase()in falcon_mouse.cpp.o
"libnifalcon::FalconCLIBase::addOptions(int)", referenced from:
FalconMouse::addOptions(int) in falcon_mouse.cpp.o
"libnifalcon::FalconCLIBase::parseOptions(int, char**)", referenced from:
FalconMouse::parseOptions(int, char**)in falcon_mouse.cpp.o
"libnifalcon::FalconCLIBase::FalconCLIBase()", referenced from:
FalconMouse::FalconMouse()in falcon_mouse.cpp.o
"libnifalcon::FalconKinematicStamper::FalconKinematicStamper(bool)", referenced from:
void libnifalcon::FalconDevice::setFalconKinematiclibnifalcon::FalconKinematicStamper()in falcon_mouse.cpp.o
"libnifalcon::FalconDevice::runIOLoop(unsigned int)", referenced from:
FalconMouse::runMouseLoop() in falcon_mouse.cpp.o
"typeinfo for libnifalcon::FalconCLIBase", referenced from:
typeinfo for FalconMousein falcon_mouse.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [bin/falcon_mouse] Error 1
make[1]: *** [examples/CMakeFiles/falcon_mouse.dir/all] Error 2
make: *** [all] Error 2

Do you know why and or how I fix? I have tried forcing an x32 compile but that doesn't seem to make a difference!

Firmware loading issues

I am trying to make the Novint Falcon work in Kubuntu 14.04 and as per instructions I was able to successfully build and install the libnifalcon package. I am using a Belkin Powered USB Hub to connect it to the pc. When I try to run any of the example programs I get errors.

When I run findfalcons I get the following:
Falcons found: 1
Opening falcon 1
Opened falcon
Loading firmware
Could not load firmware

When I run falcon_led I get the following:
Loading firmware
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::exception_detail::error_info_injector<boost::bad_any_cast >'
what(): boost::bad_any_cast: failed conversion using boost::any_cast
Aborted (core dumped)

I have tried all the USB ports on the PC and the hub. What could be the issue?

falcon_led utility broken

In "falcon_led" I chose the following parameters:

andrea$ ./falcon_led --device_index 0 --nvent_firmware --led_red

and get the following output:

Turning on RED LED

However all LED are OFF.

Could not load FalconFirmware

Hi,

I am running into a wall trying to run my Novint Falcon.

Here are my steps simplified :

// Init device
auto falconDevice = new libnifalcon::FalconDevice;
falconDevice->setFalconFirmware<libnifalcon::FalconFirmwareNovintSDK>();
falconDevice->setFalconKinematic<libnifalcon::FalconKinematicStamper>();
falconDevice->setFalconGrip<libnifalcon::FalconGripFourButton>();

// Open device
falconDevice->open(0)

// Load firmware
for(int i = 0; i < 10; ++i)
{
    if (!falconDevice->isFirmwareLoaded())
    {
        auto skip_checksum = false;
        auto firmware_size = libnifalcon::NOVINT_FALCON_NVENT_FIRMWARE_SIZE;
        auto buffer = const_cast<uint8_t*>(libnifalcon::NOVINT_FALCON_NVENT_FIRMWARE);
        auto loaded = m_falconDevice->getFalconFirmware()->loadFirmware(skip_checksum, firmware_size, buffer);
    }
}

Opening the device succeeds (returns true), not loading the firmware (loaded always false).

I get FALCON_FIRMWARE_CHECKSUM_MISMATCH (3004) error at the end of FalconFirmware::loadFirmware():

For READ_SIZE = 62, if get the error for

  • total_read = 0
  • bytes_check = 0
  • i=44.

For READ_SIZE = 58, if get the error for

  • total_read = 0
  • bytes_check = 0
  • i=26.

Is there anything else to do than set FalconFirmwareNovintSDK to load the firmware successfully? I did this based on the barrow_mechanics and findfalcons example.

I can't use from python

After install and change OFF to ON in CMakeLists.txt the corresponding lines:

OPTION(STATIC_LINK_SUFFIXES "Add a symbolic link with [library_name]_s on static libraries (for ease in building staticly linked binaries under gcc)" ON)
OPTION(BUILD_SWIG_BINDINGS "Build Java/Python bindings for libnifalcon" ON)
OPTION(BUILD_EXAMPLES "Build libnifalcon examples" ON)

I try .py examples from build folder and this not function... Not found pynifalcon module.
I think that is like a path problem... Can anybody helpme? Thanks!

Issues with Java building

From email:

With the example JNIFalconCubeTest, I copied from /libnifalcon/build/lang/swig/ to /libnifalcon/lang/examples/java/JNIFalconCubeTest/ the files:

FalconDeviceBridge.java
FalconVec3d.java
JNIFalcon.java
JNIFalconJNI.java

And compile with:

javac JNIFalconCubeTest.java
java JNIFalconCubeTest

but show:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no JNIFalcon in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at JNIFalconCubeTest.(JNIFalconCubeTest.java:4)
Could not find the main class: JNIFalconCubeTest. Program will exit.

Then I read forums and changed JNIFaclconCubeTest.java in the line 4 to:

System.load("/libnifalcon/build/lib/libJNIFalcon.so");

Next, i got the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/alejo/libnifalcon/build/lib/libJNIFalcon.so: libmawt.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at JNIFalconCubeTest.(JNIFalconCubeTest.java:4)
Could not find the main class: JNIFalconCubeTest. Program will exit.

segfault issues on closing device

I've encountered some seg faults occurring with the linux libnifalcon in the destructor. This occurs if the device is destroyed before the thread exits. Here's the diff of what i put in to fix the issue.

  Index: src/core/FalconDevice.cpp
 ===================================================================
 --- src/core/FalconDevice.cpp  (revision 55869) 
 +++ src/core/FalconDevice.cpp  (working copy)
 @@ -35,6 +35,7 @@
      FalconDevice::~FalconDevice()
    {
 +        close();
    }
     bool FalconDevice::getDeviceCount(unsigned int& count)
 Index: src/comm/FalconCommLibUSB.cpp
 ===================================================================
 --- src/comm/FalconCommLibUSB.cpp  (revision 55869)
 +++ src/comm/FalconCommLibUSB.cpp  (working copy)
 @@ -248,8 +248,8 @@
            return false;
        }
 -      libusb_close(m_falconDevice);
        reset();
 +        libusb_close(m_falconDevice);
        m_falconDevice = NULL;
        return true;
    }
 Index: src/util/FalconDeviceBoostThread.cpp
 ===================================================================
 --- src/util/FalconDeviceBoostThread.cpp   (revision 55869)
 +++ src/util/FalconDeviceBoostThread.cpp   (working copy)
 @@ -16,12 +16,13 @@
  namespace libnifalcon
  {
 -  FalconDeviceBoostThread::FalconDeviceBoostThread() : m_runThreadLoop(false) 
 +  FalconDeviceBoostThread::FalconDeviceBoostThread() :  m_runThreadLoop(false),m_ioThread((boost::thread*)NULL)
    {
    }
    FalconDeviceBoostThread::~FalconDeviceBoostThread()
    {
 +        stopThread();
    }
    void FalconDeviceBoostThread::getPosition(boost::array<double, 3>& pos)
 @@ -51,5 +52,7 @@
    void FalconDeviceBoostThread::stopThread()
    {
        m_runThreadLoop = false;
 +      if( m_ioThread )
 +          m_ioThread->join();
    }
  }

Linux (Debian Jessie w/ Kernel 3.14.2) no longer needs powered usb hub?

Just got support email from someone who was having problems running libnifalcon on linux. Firmware loading was extremely flakey. Tried it myself, and sure enough, the instructions in the readme to always use a powered USB hub no longer seem to work. I had to plug the falcon directly into a usb port on my thinkpad to get firmware to load. Once firmware was loaded, things seemed to work fine.

Not sure what changed or when to cause this, but it might be worth updating README to reflect the issue.

Errors with make

[ 44%] Building CXX object src/util/CMakeFiles/nifalcon_cli_base_SHARED.dir/FalconCLIBase.cpp.o
Linking CXX shared library ../../lib/libnifalcon_cli_base.so

/usr/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libboost_program_options.a(cmdline.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../lib/libboost_program_options.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

make[2]: *** [lib/libnifalcon_cli_base.so.1.0.0] Error 1
make[1]: *** [src/util/CMakeFiles/nifalcon_cli_base_SHARED.dir/all] Error 2
make: *** [all] Error 2

Forces in 2 directions in effector-space do not create correct joint-space force vector

From issue email:

I am modifying your cube_test example. Instead of keeping the end effector outside of the cube, I'd like to keep it inside. Yet when I do this, it works fine if you move straight along an axis however you end up going right through the corners of the cube. After a bunch of tests, it appears that the falcon cannot exert a strong force along 2 axes at the same time. Do you know if this is true? any other possible suggestions?

Settle on a USB communications library

At the time libnifalcon was written, it was hard to find a usb/ftdi library that supported our async needs. That's probably changed in the past few years. Would be nice to settle on a single cross platform library that suits our requirements.

Coordinate plans for libnifalcon development

@AlexJaeger @FabienDanieau

Just making a general issue for figuring out what to do next now that libnifalcon has multiple devs with push access. Right now I'm trying to get the documentation into the repo, and may update the project webpage to reflect the new links (I still get emails every so often from confused students looking for papers, heh). Would also be interested to know what you'd like to see done with the repo.

Honestly, I'd love to see this rewritten in C just because C++ was a mistake in the first place, though with C++11/14 it's certainly better than the state it was in when I was using boost. I still think it's way overcomplicated though.

I'd also like to take another crack at refining the kinematics algorithms, though that's gonna be pretty involved.

Tag a new release

Hi, I compiled the 1.0.1 version and I had segfaults while running the findfalcon command, while on master everything works.

Could you tag a release like 1.0.2? Thanks, Nicolò

Rework kinematics

Quoting @qdot from #52 (comment)

Since Ghidra came out, I've done some vague looking at maybe upgrading our kinematics functions to match the original Falcon kinematics, as the algorithms in libnifalcon have always been an issue, especially at the edges of the workspace. Would you be interested, or happen to know of anyone interested, in helping out with that? My main problem is severe lack of time. :)

What would be your procedure?

Reverse-engineering the driver with ghidra?
Also modeling mechanics and kinematics with nifalcon_mechanics?

erratic behaviour on first use

Hi all,

I noticed that the falcon has an erratic behaviour on first use. The usual response is:

# findfalcons

Falcons found: 1
Opening falcon 1
Opened falcon
Loading firmware
Could not load firmware

# falcon_test_cli --device_index 0 --cube_test

Loading firmware
No firmware loaded to device, cannot continue

After a while it starts working again. I have not been able to track down exactly what makes it work; I have tried all possible combinations of --force-firmware, --skip-checksum and all USB ports on my machine. I have tried it without its own power adaptor (just USB-powered) and with.

Falcon is a Novint Falcon NF1-S01-005 purchased within 12 months.

# lsusb

Bus 005 Device 003: ID 0403:cb48 Future Technology Devices International, Ltd

I have a suspicion that this might be related to some UART or serial timeout but I do not know how to narrow it down. Any hint?

Regarding linux, I tried on a ubuntu 10.10 and fedora 14, compiling libnifalcon from scratch.

Modernize the build system

Oh, the CMake mess I made. Remove references to compily_build and make simple cmake instructions that fit in the README.

Should I make libnifalcon an organization repo? We need more maintainers

I did not realize I wasn't getting notifications for libnifalcon issues, which means we've had nice fixes in pull requests sitting around, sometimes for years. If I move this to be an organization repo, would others be interested in helping out with maintenance? Please reply here if interested and I'll try to keep up.

Fix whitespace

Many of the code files are a mess. Need to fix up whitespace and make sure everything is indented correctly and what not.

Fix website so documentation links work again

Getting a lot of 404s going to the docs.nonpolynomial.com, which I took down a long time ago. I should just add the research papers to the git repo and link there, as well as point the project site to my portfolio page, versus trying to have it as its own site.

Baud rate changes cause oddly timed injection of null character

From email from Jason Ekstrand:

I noticed that when you change the baudrate on the FTDI chip, about 50% of the time, it will leave you with a stray null character in the output buffer. My solution to this was to change the baudrate, wait a few milliseconds, and flush the buffer. After accounting for this stray null character, I discovered that the string returned by the falcon in the "Firmware Reset" stage is actually "\x0a\x44\x2c\x0d", not "\x00\x0a\x44\x2c\x0d".

Turn Python bindings into their own repo, with this repo as a submodule

Having the python bindings in this repo means trying to make API changes will be difficult. Would also be nice to finally make libnifalcon a python module downloadable from package managers. So, we should extract out the python stuff and make a libnifalcon-py repo with a submodule for the LKG version of libnifalcon for the bindings.

Making falcon_mouse; undefined reference to boost::system::generic_category()

Make fails with the following errors while trying to link falcon_mouse:

Linking CXX executable
../bin/falcon_mouseCMakeFiles/falcon_mouse.dir/falcon_mouse/falcon_mouse.cpp.o: In function __static_initialization_and_destruction_0(int, int)':falcon_mouse.cpp:(.text+0x453): undefined reference to boost::system::generic_category()'

The issue was resolved by manually adding -lboost_system to build/examples/CMakeFiles/falcon_mouse.dir/link.txt

Issue observed with version libnifalcon 1.0.1 (commit 1fdea14) on Arch Linux.

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.