Skip to content
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

[proposal] Add class for single link model. #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snozawa
Copy link
Contributor

@snozawa snozawa commented Dec 11, 2015

This PR is just a proposal to add class for single link model
(related with @furushchev dinner discussion).
This is originally from https://github.com/jsk-ros-pkg/jsk_demos/blob/master/jsk_2015_06_hrp_drc/drc_task_common/euslisp/drc-testbed-models.l#L9.

This is used for creating single rigid body object model.

In this PR, I added single-link-model class, but I think adding function to create single link model is another solution.

@furushchev
FYI, in euslisp, robot models and object models should be defined as cascaded-link class (or its subclass).

  • historical situation
    Even if simple shape (like make-cube) and single rigid body object,
    it would be better to define it as cascaded-link instead of body or bodyset class.
    In euslib/rbrain, object models were defined as both robot-object (old style object model class) and body or bodyset class.
    It was very confusing.
    Since used methods are quite different between robot-object and body, some codes for robot-object did not work for body and it was difficult to generalize codes.
  • definition
    In euslisp, body, bodyset, faceset, ... classes have geometric shape information.
    bodyset-link class has shape information and mass information and this class corresponds to so cold link in robotics fields.
    cascaded-link class includes links, joints, and some other semantic information and this class corresponds to robot and object.
    So, it would be better to define object model as cascaded-link class.
    The codes in this PR may be minimal codes to define cascaded-link class with single link.

@k-okada
Copy link
Member

k-okada commented Dec 12, 2015

how abut add link/joint keyward option in init method of cascaded-link ?

◉ Kei Okada

On Fri, Dec 11, 2015 at 11:58 PM, Shunichi Nozawa [email protected]
wrote:

This PR is just a proposal to add class for single link model
(related with @furushchev https://github.com/furushchev dinner
discussion).
This is originally from
https://github.com/jsk-ros-pkg/jsk_demos/blob/master/jsk_2015_06_hrp_drc/drc_task_common/euslisp/drc-testbed-models.l#L9
.

This is used for creating single rigid body object model.

In this PR, I added single-link-model class, but I think adding function
to create single link model is another solution.

@furushchev https://github.com/furushchev
FYI, in euslisp, robot models and object models should be defined as
cascaded-link class (or its subclass).

historical situation
Even if simple shape (like make-cube) and single rigid body object,
it would be better to define it as cascaded-link instead of body or
bodyset class.
In euslib/rbrain, object models were defined as both robot-object (old
style object model class) and body or bodyset class.
It was very confusing.
Since used methods are quite different between robot-object and body,
some codes for robot-object did not work for body and it was difficult
to generalize codes.

definition
In euslisp, body, bodyset, faceset, ... classes have geometric shape
information.
bodyset-link class has shape information and mass information and this
class corresponds to so cold link in robotics fields.
cascaded-link class includes links, joints, and some other semantic
information and this class corresponds to robot and object.
So, it would be better to define object model as cascaded-link class.
The codes in this PR may be minimal codes to define cascaded-link
class with single link.


You can view, comment on, or merge this pull request online at:

#321
Commit Summary

  • [irteus/irtrobot.l] Add class for single link model.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#321.

@snozawa
Copy link
Contributor Author

snozawa commented Dec 13, 2015

Thanks.
Current needs is functionality to generate an object model from list of body or bodyset.
This is not necessary, but convenient functionality.

how abut add link/joint keyward option in init method of cascaded-link ?

In this case, this corresponds to add :bodies argument for cascaded-link and
generate cascaded-link instance with a single link and no joints.
Is this OK?

@k-okada
Copy link
Member

k-okada commented Dec 14, 2015

please provide us an example code

◉ Kei Okada

On Sun, Dec 13, 2015 at 7:22 PM, Shunichi Nozawa [email protected]
wrote:

Thanks.
Current needs is functionality to generate an object model from list of
body or bodyset.
This is not necessary, but convenient functionality.

how abut add link/joint keyward option in init method of cascaded-link ?

In this case, this corresponds to add :bodies argument for cascaded-link
and
generate cascaded-link instance with a single link and no joints.
Is this OK?


Reply to this email directly or view it on GitHub
#321 (comment).

@snozawa
Copy link
Contributor Author

snozawa commented Dec 14, 2015

I provide :bodies argument version:

(defmethod cascaded-link
  (:init (&rest args
                &key name
                     ((:bodies bs))
                &allow-other-keys)
         "Create cascaded-link."
         (send-super-lexpr :init args)
         (when bs
           (push (instance bodyset-link :init (make-cascoords)
                           :bodies bs :name :root-link)
                 links)
           (send self :assoc (car links)))
))

Example code:

(setq *obj* (instance cascaded-link :init :bodies (list (make-cube 100 100 100) (make-cylinder 40 200))))
(send *obj* :init-ending)
(objects (list *obj*))

Original example in this PR method:

(setq *obj* (instance single-link-model :init :bodies (list (make-cube 100 100 100) (make-cylinder 40 200))))
(objects (list *obj*))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants