-
Notifications
You must be signed in to change notification settings - Fork 56
Add eusbullet for using bullet collision function #538
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
Conversation
Travis test No.5 (
When doing compiled
|
I use this |
@@ -25,7 +25,7 @@ if [ "$(which sudo)" == "" ]; then apt-get update && apt-get install -y sudo; el | |||
travis_time_end | |||
|
|||
travis_time_start setup.apt-get_install | |||
sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi # msttcorefonts could not install on 14.04 travis | |||
sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi pkg-config libbullet-dev # msttcorefonts could not install on 14.04 travis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also update README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated: 7aa804f
irteus/BULLET/BulletCollision.cpp
Outdated
} | ||
|
||
long callCalcCollisionDistance(long modelAddrA, long modelAddrB, | ||
double *posA, double *quatA, double *posB, double *quatB, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I wrote in mmurooka#1 's commit, I you could not pass (float-vector 0 0 0)
to the double *
in 32bit machine, it has to be float *
. Please check this and if it is not clearly described in manual, we should update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding, before updating defforein
document, more basic Data Types manual is totally incorrect for 64bit machine (especially the following figure), is it right?
@@ -0,0 +1,33 @@ | |||
include Makefile.$(ARCHDIR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
irteus/PQP
contains all PQP sources, and if we create irteus "BULLET`, then we should include all source.
Otherwise, I think we'd better to create CBULLETC.C
and eusbullet.c
, which solves float/double issue more cleaner approach -> https://github.com/euslisp/jskeus/blob/master/irteus/euspqp.c#L76-L78
please also consider creating irtcollision.l
file that includes
(defmethod cascaded-coords
(:make-collisionmodel ))
(defun collision-check)
(defun collision-distance)
(defun collision-check-objects)
and add something like (defun select-collision-algorithm)
or `collision-algorithm,
please also remove 'eusbullet' from demo/eusbullet-collision.l
, and enable user to compare pqp
and bullet
Please consider updating https://jskeus.readthedocs.io/ja/latest/pqp.html, in the first section (call PQP from irteus) is mainly explaining implementation so you can put the end of the document and that of bullet library is not necessary. update pqp-collision-check
and other to collision-check
version, add collision-check-objects
example, and also need explanation of the difference between pqp and bullet.
test code should be run on both pqp/bullet and also we'd like to check for cube/matrix cases.
CC += -m32 | ||
LD += -m32 | ||
EXELD += -m32 | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently we do not check i386
on travis, but do you need this? do we still running euslisp on 32bit intel machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, we do not need intel 32bit. This Makefile.Linux
is just copied from PQP/Makefile.Linux.
If these lines should be removed, I can. But it may be beyond this PR, and we can discuss this in new Issue.
irteus/Makefile
Outdated
# check bullet version | ||
BULLET_VER_MAJOR:=$(shell pkg-config bullet --modversion | cut -f1 -d.) | ||
BULLET_VER_MINOR:=$(shell pkg-config bullet --modversion | cut -f2 -d.) | ||
export BULLET_GE_2_83=$(shell [ $(BULLET_VER_MAJOR) -gt 2 -o \( $(BULLET_VER_MAJOR) -eq 2 -a $(BULLET_VER_MINOR) -ge 83 \) ] && echo true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand exactly but if we do not have bullet it outputs too many 1: [: -gt: unexpected operator
HOGE=$(shell echo "ng")
all:
echo "ok"
echo $(HOGE)
echo $(HOGE)
echo $(HOGE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 9a6aeab. referenced https://stackoverflow.com/a/5586785
irteus/compile_irtg.l
Outdated
@@ -31,6 +31,8 @@ | |||
|
|||
(comp:compile-file-if-src-newer "irtgeo.l" user::*objdir*) | |||
(comp:compile-file-if-src-newer "pqp.l" user::*objdir*) | |||
(if (string= (unix:getenv "BULLET_GE_2_83") "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think compile eusbullet.l for all cases is ok. just to
void BulletcalcCollisionDistance() {
#if HAVE_BULLET
#else
fpritnf(stderr, "jskeus is compile without bullet, so you can not use function %s, Please install bullet > 2.83\n", __PRETTY_FUNCTION__); or something
#endif
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 2a89385.
Now, compile eusbullet.l and BulletCollision.cpp even if bullet is not installed, and check bullet installed as follows:
jskeus/irteus/BULLET/BulletCollision.cpp
Lines 56 to 60 in 2a89385
#if HAVE_BULLET | |
#define CALL_WITH_BULLET_CHECK(X) X | |
#else | |
#define CALL_WITH_BULLET_CHECK(X) fprintf(stderr, "jskeus is compiled without bullet, so you can not use function %s, Please install bullet >= 2.83\n", __PRETTY_FUNCTION__); return -1; | |
#endif |
Not smart point is that I should comment out some parts with macro's if
to avoid compile error of undefined function:
jskeus/irteus/BULLET/BulletCollision.cpp
Lines 244 to 257 in 2a89385
#if HAVE_BULLET | |
double _posA[3], _quatA[4], _posB[3], _quatB[4]; | |
double _dist[1], _dir[3], _pA[3], _pB[3]; | |
eusinteger_t ret; | |
for (int i = 0; i < 3; i++ ) {_posA[i] = posA[i]; _posB[i] = posB[i]; } | |
for (int i = 0; i < 4; i++ ) {_quatA[i] = quatA[i]; _quatB[i] = quatB[i]; } | |
_dist[0] = dist[0]; | |
for (int i = 0; i < 3; i++ ) {_dir[i] = dir[i]; _pA[i] = pA[i]; _pB[i] = pB[i];} | |
ret = calcCollisionDistance(modelAddrA, modelAddrB, | |
_posA, _quatA, _posB, _quatB, | |
_dist, _dir, _pA, _pB); | |
dist[0] = _dist[0]; | |
for (int i = 0; i < 3; i++ ) {dir[i] = _dir[i]; pA[i] = _pA[i]; pB[i] = _pB[i];} | |
#endif |
f1c36aa
to
2a89385
Compare
… callling bullet collision utility from euslisp.
…st for Ubuntu trusty and Debian jessie because bullet is old.
…ssary for 32 bit machine
…n/sh: 1: [: -gt: unexpected operator
…immediately from C function in the case of not bullet.
9a6aeab
to
7994441
Compare
Move to #555. Please review when you have time. |
From jsk-ros-pkg/jsk_roseus#604 (comment).
Call bullet collision function from euslisp. Bullet can calculate penetration depth, which cannot be calculated by PQP.
Eusbullet module is added to
irteusg
, which is same target with PQP.irteus/test/test-eusbullet-collision.l
is called in travis, which compares collision distance result with analytical result for two spheres.(same with jsk-ros-pkg/jsk_roseus#604 's test: https://user-images.githubusercontent.com/6636600/53302044-7d04d380-389d-11e9-8350-e9d392714962.gif )
BulletCollision/NarrowPhaseCollision/btGjkCollisionDescription.h
is contained in libbullet-dev (2.83) of xenial (16.04):https://packages.ubuntu.com/xenial/amd64/libbullet-dev/filelist
but not contained in libbullet-dev (2.81) of trusty (14.04):
https://packages.ubuntu.com/trusty/amd64/libbullet-dev/filelist
So, eusbullet is build only when
pkg-config bullet --modversion
is greater or equal to2.83
,and
test-eusbullet-collision.l
is not called for travis test of Ubuntu trusty and Debian jessie.4196ad6