question about loading and animating a sequence of point data

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

question about loading and animating a sequence of point data

Paul E. Rybski
Hi,
        I've got some <x,y,z> point cloud data that I collected from a laser
scanner and would like to play back a sequence of saved laser scans in
openrave to create an animation.  What would be the recommended way for
me to do this?  Can I load the entire laser sequence into openrave at
once as maybe a set of VRML files and then make each one visible in
turn?  Can I make use of openrave's ability to visualize live laser data
and instead pass in the saved data instead?

On a related note, I'll also be generating a set of voxels around the
laser data and want to create/display boxes of the appropriate voxel
dimensions than just the individual points.  Once again I'd like to play
back a sequence of these as per the data that I collected.  What would
be a good way to play back a set of "snapshots" where each snapshot is
made up of a set of openrave objects?

Thanks,

-Paul


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
Hi Paul,

The best way is to use the plotting features of openrave. Just create
a new plot for every new laser scan and destroy the old one. The live
sensor data you see in the laser sensors does this. In matlab it would
look something like:

prevhandle = 0;
for each laser scan
  newhandle = orEnvPlot(newlaserdata);
  orEnvClose(prevhandle);
  prevhandle = newhandle;
  pause(time_in_seconds);
end

In C++, you can create a thread in your plugin that does this so you
don't have to worry about it. It is very important that you create the
new laser data before deleting the old, otherwise you might get
flickering, which might get quite annoying.

If you will be using the voxel boses for collision detection, it is
best to create them as kinbodies. If they are just for display, it is
best to use the openrave plotting, as it will be faster.

The fastest way of doing this when using kinbodies, is to create them
all at once then add/remove them from the environment (without
deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
done through a plugin.

rosen,

2008/7/28 Paul E. Rybski <[hidden email]>:

> Hi,
>        I've got some <x,y,z> point cloud data that I collected from a laser
> scanner and would like to play back a sequence of saved laser scans in
> openrave to create an animation.  What would be the recommended way for
> me to do this?  Can I load the entire laser sequence into openrave at
> once as maybe a set of VRML files and then make each one visible in
> turn?  Can I make use of openrave's ability to visualize live laser data
> and instead pass in the saved data instead?
>
> On a related note, I'll also be generating a set of voxels around the
> laser data and want to create/display boxes of the appropriate voxel
> dimensions than just the individual points.  Once again I'd like to play
> back a sequence of these as per the data that I collected.  What would
> be a good way to play back a set of "snapshots" where each snapshot is
> made up of a set of openrave objects?
>
> Thanks,
>
> -Paul
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
Forgot to mention that removing kinbodies from the environment removes
them from collision detection and stops rendering them, but does not
deallocate their resources.

rosen,

2008/7/28 Rosen Diankov <[hidden email]>:

> Hi Paul,
>
> The best way is to use the plotting features of openrave. Just create
> a new plot for every new laser scan and destroy the old one. The live
> sensor data you see in the laser sensors does this. In matlab it would
> look something like:
>
> prevhandle = 0;
> for each laser scan
>  newhandle = orEnvPlot(newlaserdata);
>  orEnvClose(prevhandle);
>  prevhandle = newhandle;
>  pause(time_in_seconds);
> end
>
> In C++, you can create a thread in your plugin that does this so you
> don't have to worry about it. It is very important that you create the
> new laser data before deleting the old, otherwise you might get
> flickering, which might get quite annoying.
>
> If you will be using the voxel boses for collision detection, it is
> best to create them as kinbodies. If they are just for display, it is
> best to use the openrave plotting, as it will be faster.
>
> The fastest way of doing this when using kinbodies, is to create them
> all at once then add/remove them from the environment (without
> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
> done through a plugin.
>
> rosen,
>
> 2008/7/28 Paul E. Rybski <[hidden email]>:
>> Hi,
>>        I've got some <x,y,z> point cloud data that I collected from a laser
>> scanner and would like to play back a sequence of saved laser scans in
>> openrave to create an animation.  What would be the recommended way for
>> me to do this?  Can I load the entire laser sequence into openrave at
>> once as maybe a set of VRML files and then make each one visible in
>> turn?  Can I make use of openrave's ability to visualize live laser data
>> and instead pass in the saved data instead?
>>
>> On a related note, I'll also be generating a set of voxels around the
>> laser data and want to create/display boxes of the appropriate voxel
>> dimensions than just the individual points.  Once again I'd like to play
>> back a sequence of these as per the data that I collected.  What would
>> be a good way to play back a set of "snapshots" where each snapshot is
>> made up of a set of openrave objects?
>>
>> Thanks,
>>
>> -Paul
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Openrave-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Paul E. Rybski
Does this mean that once they're created, by invoking add and remove, I
can get them to turn on and off quickly?  My thought is that I would
create a plugin that would load a sequence of these snapshots, allocate
all of the resources necessary to display all the voxels and then just
cycle through the voxel displays in order.

-Paul

Rosen Diankov wrote:

> Forgot to mention that removing kinbodies from the environment removes
> them from collision detection and stops rendering them, but does not
> deallocate their resources.
>
> rosen,
>
> 2008/7/28 Rosen Diankov <[hidden email]>:
>> Hi Paul,
>>
>> The best way is to use the plotting features of openrave. Just create
>> a new plot for every new laser scan and destroy the old one. The live
>> sensor data you see in the laser sensors does this. In matlab it would
>> look something like:
>>
>> prevhandle = 0;
>> for each laser scan
>>  newhandle = orEnvPlot(newlaserdata);
>>  orEnvClose(prevhandle);
>>  prevhandle = newhandle;
>>  pause(time_in_seconds);
>> end
>>
>> In C++, you can create a thread in your plugin that does this so you
>> don't have to worry about it. It is very important that you create the
>> new laser data before deleting the old, otherwise you might get
>> flickering, which might get quite annoying.
>>
>> If you will be using the voxel boses for collision detection, it is
>> best to create them as kinbodies. If they are just for display, it is
>> best to use the openrave plotting, as it will be faster.
>>
>> The fastest way of doing this when using kinbodies, is to create them
>> all at once then add/remove them from the environment (without
>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>> done through a plugin.
>>
>> rosen,
>>
>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>> Hi,
>>>        I've got some <x,y,z> point cloud data that I collected from a laser
>>> scanner and would like to play back a sequence of saved laser scans in
>>> openrave to create an animation.  What would be the recommended way for
>>> me to do this?  Can I load the entire laser sequence into openrave at
>>> once as maybe a set of VRML files and then make each one visible in
>>> turn?  Can I make use of openrave's ability to visualize live laser data
>>> and instead pass in the saved data instead?
>>>
>>> On a related note, I'll also be generating a set of voxels around the
>>> laser data and want to create/display boxes of the appropriate voxel
>>> dimensions than just the individual points.  Once again I'd like to play
>>> back a sequence of these as per the data that I collected.  What would
>>> be a good way to play back a set of "snapshots" where each snapshot is
>>> made up of a set of openrave objects?
>>>
>>> Thanks,
>>>
>>> -Paul
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Openrave-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>
>

--
Paul E. Rybski, Ph.D., Systems Scientist
Robotics Institute, Carnegie Mellon University
Phone: 412-268-7417, Fax: 412-268-7350
Web: http://www.cs.cmu.edu/~prybski


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
> Does this mean that once they're created, by invoking add and remove, I
> can get them to turn on and off quickly?
Yes, it will be quick, but I'm not sure by how much.

>  My thought is that I would
> create a plugin that would load a sequence of these snapshots, allocate
> all of the resources necessary to display all the voxels and then just
> cycle through the voxel displays in order.
What do you mean by 'cycle through voxel displays in order'? None of
the plugins have control over the rendering thread. They can only post
a message to plot different objects or add/remove kinbodies from the
environment. Note the usage of 'post' here, calling a plotting
function is non-blocking for efficiency reasons.

rosen,

> -Paul
>
> Rosen Diankov wrote:
>> Forgot to mention that removing kinbodies from the environment removes
>> them from collision detection and stops rendering them, but does not
>> deallocate their resources.
>>
>> rosen,
>>
>> 2008/7/28 Rosen Diankov <[hidden email]>:
>>> Hi Paul,
>>>
>>> The best way is to use the plotting features of openrave. Just create
>>> a new plot for every new laser scan and destroy the old one. The live
>>> sensor data you see in the laser sensors does this. In matlab it would
>>> look something like:
>>>
>>> prevhandle = 0;
>>> for each laser scan
>>>  newhandle = orEnvPlot(newlaserdata);
>>>  orEnvClose(prevhandle);
>>>  prevhandle = newhandle;
>>>  pause(time_in_seconds);
>>> end
>>>
>>> In C++, you can create a thread in your plugin that does this so you
>>> don't have to worry about it. It is very important that you create the
>>> new laser data before deleting the old, otherwise you might get
>>> flickering, which might get quite annoying.
>>>
>>> If you will be using the voxel boses for collision detection, it is
>>> best to create them as kinbodies. If they are just for display, it is
>>> best to use the openrave plotting, as it will be faster.
>>>
>>> The fastest way of doing this when using kinbodies, is to create them
>>> all at once then add/remove them from the environment (without
>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>> done through a plugin.
>>>
>>> rosen,
>>>
>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>> Hi,
>>>>        I've got some <x,y,z> point cloud data that I collected from a laser
>>>> scanner and would like to play back a sequence of saved laser scans in
>>>> openrave to create an animation.  What would be the recommended way for
>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>> once as maybe a set of VRML files and then make each one visible in
>>>> turn?  Can I make use of openrave's ability to visualize live laser data
>>>> and instead pass in the saved data instead?
>>>>
>>>> On a related note, I'll also be generating a set of voxels around the
>>>> laser data and want to create/display boxes of the appropriate voxel
>>>> dimensions than just the individual points.  Once again I'd like to play
>>>> back a sequence of these as per the data that I collected.  What would
>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>> made up of a set of openrave objects?
>>>>
>>>> Thanks,
>>>>
>>>> -Paul
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Openrave-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>
>>
>
> --
> Paul E. Rybski, Ph.D., Systems Scientist
> Robotics Institute, Carnegie Mellon University
> Phone: 412-268-7417, Fax: 412-268-7350
> Web: http://www.cs.cmu.edu/~prybski
>


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Paul E. Rybski
I have voxel data created from 'N' snapshots of a 3D lidar.  I want to
display each snapshot as a set of voxels.  So, if I have 'N' snapshots,
I want to display them, one after the other, in as close to real time as
I can so that the display shows an animation.  My thought would be that
I would tell openrave to display the first set, let it stay on the
display for some fixed amount of time, then tell that set to disappear
and tell the second set to display and so forth.

Does this make sense?  Is there an easier way to do this?  The reason I
want to use voxels is because the size is uniform regardless of how I
zoom the camera in and out of the display.

-Paul

Rosen Diankov wrote:

>> Does this mean that once they're created, by invoking add and remove, I
>> can get them to turn on and off quickly?
> Yes, it will be quick, but I'm not sure by how much.
>
>>  My thought is that I would
>> create a plugin that would load a sequence of these snapshots, allocate
>> all of the resources necessary to display all the voxels and then just
>> cycle through the voxel displays in order.
> What do you mean by 'cycle through voxel displays in order'? None of
> the plugins have control over the rendering thread. They can only post
> a message to plot different objects or add/remove kinbodies from the
> environment. Note the usage of 'post' here, calling a plotting
> function is non-blocking for efficiency reasons.
>
> rosen,
>
>> -Paul
>>
>> Rosen Diankov wrote:
>>> Forgot to mention that removing kinbodies from the environment removes
>>> them from collision detection and stops rendering them, but does not
>>> deallocate their resources.
>>>
>>> rosen,
>>>
>>> 2008/7/28 Rosen Diankov <[hidden email]>:
>>>> Hi Paul,
>>>>
>>>> The best way is to use the plotting features of openrave. Just create
>>>> a new plot for every new laser scan and destroy the old one. The live
>>>> sensor data you see in the laser sensors does this. In matlab it would
>>>> look something like:
>>>>
>>>> prevhandle = 0;
>>>> for each laser scan
>>>>  newhandle = orEnvPlot(newlaserdata);
>>>>  orEnvClose(prevhandle);
>>>>  prevhandle = newhandle;
>>>>  pause(time_in_seconds);
>>>> end
>>>>
>>>> In C++, you can create a thread in your plugin that does this so you
>>>> don't have to worry about it. It is very important that you create the
>>>> new laser data before deleting the old, otherwise you might get
>>>> flickering, which might get quite annoying.
>>>>
>>>> If you will be using the voxel boses for collision detection, it is
>>>> best to create them as kinbodies. If they are just for display, it is
>>>> best to use the openrave plotting, as it will be faster.
>>>>
>>>> The fastest way of doing this when using kinbodies, is to create them
>>>> all at once then add/remove them from the environment (without
>>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>>> done through a plugin.
>>>>
>>>> rosen,
>>>>
>>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>> Hi,
>>>>>        I've got some <x,y,z> point cloud data that I collected from a laser
>>>>> scanner and would like to play back a sequence of saved laser scans in
>>>>> openrave to create an animation.  What would be the recommended way for
>>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>>> once as maybe a set of VRML files and then make each one visible in
>>>>> turn?  Can I make use of openrave's ability to visualize live laser data
>>>>> and instead pass in the saved data instead?
>>>>>
>>>>> On a related note, I'll also be generating a set of voxels around the
>>>>> laser data and want to create/display boxes of the appropriate voxel
>>>>> dimensions than just the individual points.  Once again I'd like to play
>>>>> back a sequence of these as per the data that I collected.  What would
>>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>>> made up of a set of openrave objects?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -Paul
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> Openrave-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>>
>> --
>> Paul E. Rybski, Ph.D., Systems Scientist
>> Robotics Institute, Carnegie Mellon University
>> Phone: 412-268-7417, Fax: 412-268-7350
>> Web: http://www.cs.cmu.edu/~prybski
>>
>

--
Paul E. Rybski, Ph.D., Systems Scientist
Robotics Institute, Carnegie Mellon University
Phone: 412-268-7417, Fax: 412-268-7350
Web: http://www.cs.cmu.edu/~prybski


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Paul E. Rybski
In reply to this post by Rosen Diankov-2
I just wanted to chime in and say that I now have a working plugin that
pre-allocates a set of kinbodies "snapshots" and turns them on and off
using the methods Ros described below in order to create my animated
voxel display.  This works great but the only odd thing is that whenever
I make a kinbody visible (or invisible...I can't remember), I get this
error:

[qtcoinviewer.cpp:1675] not possible!

I've just commented out that print statement in qtcoinviewer.cpp but I
wonder if it's really safe to ignore that message.

-Paul

Rosen Diankov wrote:

> Forgot to mention that removing kinbodies from the environment removes
> them from collision detection and stops rendering them, but does not
> deallocate their resources.
>
> rosen,
>
> 2008/7/28 Rosen Diankov <[hidden email]>:
>> Hi Paul,
>>
>> The best way is to use the plotting features of openrave. Just create
>> a new plot for every new laser scan and destroy the old one. The live
>> sensor data you see in the laser sensors does this. In matlab it would
>> look something like:
>>
>> prevhandle = 0;
>> for each laser scan
>>  newhandle = orEnvPlot(newlaserdata);
>>  orEnvClose(prevhandle);
>>  prevhandle = newhandle;
>>  pause(time_in_seconds);
>> end
>>
>> In C++, you can create a thread in your plugin that does this so you
>> don't have to worry about it. It is very important that you create the
>> new laser data before deleting the old, otherwise you might get
>> flickering, which might get quite annoying.
>>
>> If you will be using the voxel boses for collision detection, it is
>> best to create them as kinbodies. If they are just for display, it is
>> best to use the openrave plotting, as it will be faster.
>>
>> The fastest way of doing this when using kinbodies, is to create them
>> all at once then add/remove them from the environment (without
>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>> done through a plugin.
>>
>> rosen,
>>
>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>> Hi,
>>>        I've got some <x,y,z> point cloud data that I collected from a laser
>>> scanner and would like to play back a sequence of saved laser scans in
>>> openrave to create an animation.  What would be the recommended way for
>>> me to do this?  Can I load the entire laser sequence into openrave at
>>> once as maybe a set of VRML files and then make each one visible in
>>> turn?  Can I make use of openrave's ability to visualize live laser data
>>> and instead pass in the saved data instead?
>>>
>>> On a related note, I'll also be generating a set of voxels around the
>>> laser data and want to create/display boxes of the appropriate voxel
>>> dimensions than just the individual points.  Once again I'd like to play
>>> back a sequence of these as per the data that I collected.  What would
>>> be a good way to play back a set of "snapshots" where each snapshot is
>>> made up of a set of openrave objects?
>>>
>>> Thanks,
>>>
>>> -Paul
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Openrave-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>
>

--
Paul E. Rybski, Ph.D., Systems Scientist
The Robotics Institute, Carnegie Mellon University
Phone: 412-268-7417, Fax: 412-268-7350
Web: http://www.cs.cmu.edu/~prybski


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
Hi Paul,

It's one of those messages that tells the developers there's a data
race condition that must be fixed.  Just curious, do you see the
memory of your application slowly go up after many of these "not
possible" statements?

I added a bug report in sf, feel free to update it with new info.

rosen,

2008/8/6 Paul E. Rybski <[hidden email]>:

> I just wanted to chime in and say that I now have a working plugin that
> pre-allocates a set of kinbodies "snapshots" and turns them on and off using
> the methods Ros described below in order to create my animated voxel
> display.  This works great but the only odd thing is that whenever I make a
> kinbody visible (or invisible...I can't remember), I get this error:
>
> [qtcoinviewer.cpp:1675] not possible!
>
> I've just commented out that print statement in qtcoinviewer.cpp but I
> wonder if it's really safe to ignore that message.
>
> -Paul
>
> Rosen Diankov wrote:
>>
>> Forgot to mention that removing kinbodies from the environment removes
>> them from collision detection and stops rendering them, but does not
>> deallocate their resources.
>>
>> rosen,
>>
>> 2008/7/28 Rosen Diankov <[hidden email]>:
>>>
>>> Hi Paul,
>>>
>>> The best way is to use the plotting features of openrave. Just create
>>> a new plot for every new laser scan and destroy the old one. The live
>>> sensor data you see in the laser sensors does this. In matlab it would
>>> look something like:
>>>
>>> prevhandle = 0;
>>> for each laser scan
>>>  newhandle = orEnvPlot(newlaserdata);
>>>  orEnvClose(prevhandle);
>>>  prevhandle = newhandle;
>>>  pause(time_in_seconds);
>>> end
>>>
>>> In C++, you can create a thread in your plugin that does this so you
>>> don't have to worry about it. It is very important that you create the
>>> new laser data before deleting the old, otherwise you might get
>>> flickering, which might get quite annoying.
>>>
>>> If you will be using the voxel boses for collision detection, it is
>>> best to create them as kinbodies. If they are just for display, it is
>>> best to use the openrave plotting, as it will be faster.
>>>
>>> The fastest way of doing this when using kinbodies, is to create them
>>> all at once then add/remove them from the environment (without
>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>> done through a plugin.
>>>
>>> rosen,
>>>
>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>
>>>> Hi,
>>>>       I've got some <x,y,z> point cloud data that I collected from a
>>>> laser
>>>> scanner and would like to play back a sequence of saved laser scans in
>>>> openrave to create an animation.  What would be the recommended way for
>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>> once as maybe a set of VRML files and then make each one visible in
>>>> turn?  Can I make use of openrave's ability to visualize live laser data
>>>> and instead pass in the saved data instead?
>>>>
>>>> On a related note, I'll also be generating a set of voxels around the
>>>> laser data and want to create/display boxes of the appropriate voxel
>>>> dimensions than just the individual points.  Once again I'd like to play
>>>> back a sequence of these as per the data that I collected.  What would
>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>> made up of a set of openrave objects?
>>>>
>>>> Thanks,
>>>>
>>>> -Paul
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Openrave-users mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>
>>
>
> --
> Paul E. Rybski, Ph.D., Systems Scientist
> The Robotics Institute, Carnegie Mellon University
> Phone: 412-268-7417, Fax: 412-268-7350
> Web: http://www.cs.cmu.edu/~prybski
>


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Paul E. Rybski
Uh oh.  That's not good.

I ran my plugin with a "dummy" dataset of 1000 kinbody voxels being made
visible and invisible using the calls to:

EnvironmentBase::AddKinBody(pbody)
EnvironmentBase::RemoveKinBody(pbody, false)

where I showed only 100 voxels at any step.  I ran it for about 10
minutes and the memory usage never increased.  I pre-allocate all of my
kinbody objects on initialization but don't create or destroy anything
after that (e.g. at runtime).

-Paul

Rosen Diankov wrote:

> Hi Paul,
>
> It's one of those messages that tells the developers there's a data
> race condition that must be fixed.  Just curious, do you see the
> memory of your application slowly go up after many of these "not
> possible" statements?
>
> I added a bug report in sf, feel free to update it with new info.
>
> rosen,
>
> 2008/8/6 Paul E. Rybski <[hidden email]>:
>> I just wanted to chime in and say that I now have a working plugin that
>> pre-allocates a set of kinbodies "snapshots" and turns them on and off using
>> the methods Ros described below in order to create my animated voxel
>> display.  This works great but the only odd thing is that whenever I make a
>> kinbody visible (or invisible...I can't remember), I get this error:
>>
>> [qtcoinviewer.cpp:1675] not possible!
>>
>> I've just commented out that print statement in qtcoinviewer.cpp but I
>> wonder if it's really safe to ignore that message.
>>
>> -Paul
>>
>> Rosen Diankov wrote:
>>> Forgot to mention that removing kinbodies from the environment removes
>>> them from collision detection and stops rendering them, but does not
>>> deallocate their resources.
>>>
>>> rosen,
>>>
>>> 2008/7/28 Rosen Diankov <[hidden email]>:
>>>> Hi Paul,
>>>>
>>>> The best way is to use the plotting features of openrave. Just create
>>>> a new plot for every new laser scan and destroy the old one. The live
>>>> sensor data you see in the laser sensors does this. In matlab it would
>>>> look something like:
>>>>
>>>> prevhandle = 0;
>>>> for each laser scan
>>>>  newhandle = orEnvPlot(newlaserdata);
>>>>  orEnvClose(prevhandle);
>>>>  prevhandle = newhandle;
>>>>  pause(time_in_seconds);
>>>> end
>>>>
>>>> In C++, you can create a thread in your plugin that does this so you
>>>> don't have to worry about it. It is very important that you create the
>>>> new laser data before deleting the old, otherwise you might get
>>>> flickering, which might get quite annoying.
>>>>
>>>> If you will be using the voxel boses for collision detection, it is
>>>> best to create them as kinbodies. If they are just for display, it is
>>>> best to use the openrave plotting, as it will be faster.
>>>>
>>>> The fastest way of doing this when using kinbodies, is to create them
>>>> all at once then add/remove them from the environment (without
>>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>>> done through a plugin.
>>>>
>>>> rosen,
>>>>
>>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>> Hi,
>>>>>       I've got some <x,y,z> point cloud data that I collected from a
>>>>> laser
>>>>> scanner and would like to play back a sequence of saved laser scans in
>>>>> openrave to create an animation.  What would be the recommended way for
>>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>>> once as maybe a set of VRML files and then make each one visible in
>>>>> turn?  Can I make use of openrave's ability to visualize live laser data
>>>>> and instead pass in the saved data instead?
>>>>>
>>>>> On a related note, I'll also be generating a set of voxels around the
>>>>> laser data and want to create/display boxes of the appropriate voxel
>>>>> dimensions than just the individual points.  Once again I'd like to play
>>>>> back a sequence of these as per the data that I collected.  What would
>>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>>> made up of a set of openrave objects?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -Paul
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>>> challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>>> prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>>> world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> Openrave-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>>
>> --
>> Paul E. Rybski, Ph.D., Systems Scientist
>> The Robotics Institute, Carnegie Mellon University
>> Phone: 412-268-7417, Fax: 412-268-7350
>> Web: http://www.cs.cmu.edu/~prybski
>>
>

--
Paul E. Rybski, Ph.D., Systems Scientist
The Robotics Institute, Carnegie Mellon University
Phone: 412-268-7417, Fax: 412-268-7350
Web: http://www.cs.cmu.edu/~prybski


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
In reply to this post by Rosen Diankov-2
Hi Paul,

To make your life easier when generating the triangles, there's a
EnvironmentBase::Triangulate function. What you could is take the
triangles of the KinBody and successively reproduce them to form the
final triangles.

Imagine you have all the transformations of your original bodies in
vector<Tranform> vtrans, and pBodyOrig is the KinBody geometry you
want reproduced. Then all you have to do is the following code:

KinBody::Link::TRIMESH triorig, triall, tritemp;
g_pEnviron->Triangulate(triorig, pBodyOrig);
triorig.ApplyTransform(pBodyOrig->GetTransform().inverse());


FOREACH(ittrans, vtrans) {
    tritemp = triorig;
    tritemp.ApplyTransform(*ittrans);
    triall.Append(tritemp);
}

g_pEnviron->drawtrimesh(trimesh.vertices[0], sizeof(Vector),
&trimesh.indices[0], trimesh.indices.size()/3, mycolor);

I haven't run this code to double check, but it should give you an
idea of how easy it would be to  use drawtrimesh.

rosen,

2008/8/7 Paul E. Rybski <[hidden email]>:

> Great!  I'll check it out.  Many thanks!
>
> I'm hoping to find the best way to try to make use of the graphics card that
> I have in this machine.  It's an NVIDIA 8800 GTS 640M so it should be
> capable of handling quite heavy GL stuff...
>
> -Paul
>
> Rosen Diankov wrote:
>>
>> Hi Paul,
>>
>> Sorry to hear that it is that slow, you might want to try
>> EnvironmentBase::drawtrimesh. You can pass it all triangles of all
>> your boxes in one call. Then when it comes time to update your scene,
>> remove the old trimesh with EnvironmentBase::closegraph and render the
>> new trimesh. Actually to avoid flickering, you should add the second
>> trimesh before closing the first one.
>>
>> trimeshes do support transparency by setting the 4th component of the
>> color vector to a value less than 1. If you look at the laser sensor
>> demos by running testlasersensor, you'll see an example usage of the
>> trimeshes
>>
>> rosen,
>>
>>
>> 2008/8/7 Paul E. Rybski <[hidden email]>:
>>>
>>> Hi Rosen,
>>>       You said below that the fastest way to render my voxels is via
>>> KinBodies.  I did this but right now, I'm shooting at like 6000 small
>>> cubes being rendered and it's pretty slow on my 2.4GHz Q6600 Intel CPU
>>> (quad processor).  Is this really the fastest way to render volumes like
>>> this? Is there anything in between the fast scripted draw routines of
>>> EnvironmentBase and KinBodies that  I might use?  I'd love to just use
>>> the draw functions but I need the cubes I render to be the correct size
>>> no matter how I zoom in and out of the scene with my virtual camera.
>>>
>>> If not, then I'll see about finding another mechanism for maybe
>>> subsampling my data.
>>>
>>> -Paul
>>>
>>> Rosen Diankov wrote:
>>>>
>>>> Hi Paul,
>>>>
>>>> The best way is to use the plotting features of openrave. Just create
>>>> a new plot for every new laser scan and destroy the old one. The live
>>>> sensor data you see in the laser sensors does this. In matlab it would
>>>> look something like:
>>>>
>>>> prevhandle = 0;
>>>> for each laser scan
>>>>  newhandle = orEnvPlot(newlaserdata);
>>>>  orEnvClose(prevhandle);
>>>>  prevhandle = newhandle;
>>>>  pause(time_in_seconds);
>>>> end
>>>>
>>>> In C++, you can create a thread in your plugin that does this so you
>>>> don't have to worry about it. It is very important that you create the
>>>> new laser data before deleting the old, otherwise you might get
>>>> flickering, which might get quite annoying.
>>>>
>>>> If you will be using the voxel boses for collision detection, it is
>>>> best to create them as kinbodies. If they are just for display, it is
>>>> best to use the openrave plotting, as it will be faster.
>>>>
>>>> The fastest way of doing this when using kinbodies, is to create them
>>>> all at once then add/remove them from the environment (without
>>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>>> done through a plugin.
>>>>
>>>> rosen,
>>>>
>>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>>
>>>>> Hi,
>>>>>       I've got some <x,y,z> point cloud data that I collected from a
>>>>> laser
>>>>> scanner and would like to play back a sequence of saved laser scans in
>>>>> openrave to create an animation.  What would be the recommended way for
>>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>>> once as maybe a set of VRML files and then make each one visible in
>>>>> turn?  Can I make use of openrave's ability to visualize live laser
>>>>> data
>>>>> and instead pass in the saved data instead?
>>>>>
>>>>> On a related note, I'll also be generating a set of voxels around the
>>>>> laser data and want to create/display boxes of the appropriate voxel
>>>>> dimensions than just the individual points.  Once again I'd like to
>>>>> play
>>>>> back a sequence of these as per the data that I collected.  What would
>>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>>> made up of a set of openrave objects?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -Paul
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------------
>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>>> challenge
>>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>>> prizes
>>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>>> world
>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>> _______________________________________________
>>>>> Openrave-users mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>>
>>
>
> --
> Paul E. Rybski, Ph.D., Systems Scientist
> The Robotics Institute, Carnegie Mellon University
> Phone: 412-268-7417, Fax: 412-268-7350
> Web: http://www.cs.cmu.edu/~prybski
>


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
small typo, trimesh -> triall

g_pEnviron->drawtrimesh(triall.vertices[0], sizeof(Vector),
&triall.indices[0], triall.indices.size()/3, mycolor);

rosen,

2008/8/7 Rosen Diankov <[hidden email]>:

> Hi Paul,
>
> To make your life easier when generating the triangles, there's a
> EnvironmentBase::Triangulate function. What you could is take the
> triangles of the KinBody and successively reproduce them to form the
> final triangles.
>
> Imagine you have all the transformations of your original bodies in
> vector<Tranform> vtrans, and pBodyOrig is the KinBody geometry you
> want reproduced. Then all you have to do is the following code:
>
> KinBody::Link::TRIMESH triorig, triall, tritemp;
> g_pEnviron->Triangulate(triorig, pBodyOrig);
> triorig.ApplyTransform(pBodyOrig->GetTransform().inverse());
>
>
> FOREACH(ittrans, vtrans) {
>    tritemp = triorig;
>    tritemp.ApplyTransform(*ittrans);
>    triall.Append(tritemp);
> }
>
> g_pEnviron->drawtrimesh(trimesh.vertices[0], sizeof(Vector),
> &trimesh.indices[0], trimesh.indices.size()/3, mycolor);
>
> I haven't run this code to double check, but it should give you an
> idea of how easy it would be to  use drawtrimesh.
>
> rosen,
>
> 2008/8/7 Paul E. Rybski <[hidden email]>:
>> Great!  I'll check it out.  Many thanks!
>>
>> I'm hoping to find the best way to try to make use of the graphics card that
>> I have in this machine.  It's an NVIDIA 8800 GTS 640M so it should be
>> capable of handling quite heavy GL stuff...
>>
>> -Paul
>>
>> Rosen Diankov wrote:
>>>
>>> Hi Paul,
>>>
>>> Sorry to hear that it is that slow, you might want to try
>>> EnvironmentBase::drawtrimesh. You can pass it all triangles of all
>>> your boxes in one call. Then when it comes time to update your scene,
>>> remove the old trimesh with EnvironmentBase::closegraph and render the
>>> new trimesh. Actually to avoid flickering, you should add the second
>>> trimesh before closing the first one.
>>>
>>> trimeshes do support transparency by setting the 4th component of the
>>> color vector to a value less than 1. If you look at the laser sensor
>>> demos by running testlasersensor, you'll see an example usage of the
>>> trimeshes
>>>
>>> rosen,
>>>
>>>
>>> 2008/8/7 Paul E. Rybski <[hidden email]>:
>>>>
>>>> Hi Rosen,
>>>>       You said below that the fastest way to render my voxels is via
>>>> KinBodies.  I did this but right now, I'm shooting at like 6000 small
>>>> cubes being rendered and it's pretty slow on my 2.4GHz Q6600 Intel CPU
>>>> (quad processor).  Is this really the fastest way to render volumes like
>>>> this? Is there anything in between the fast scripted draw routines of
>>>> EnvironmentBase and KinBodies that  I might use?  I'd love to just use
>>>> the draw functions but I need the cubes I render to be the correct size
>>>> no matter how I zoom in and out of the scene with my virtual camera.
>>>>
>>>> If not, then I'll see about finding another mechanism for maybe
>>>> subsampling my data.
>>>>
>>>> -Paul
>>>>
>>>> Rosen Diankov wrote:
>>>>>
>>>>> Hi Paul,
>>>>>
>>>>> The best way is to use the plotting features of openrave. Just create
>>>>> a new plot for every new laser scan and destroy the old one. The live
>>>>> sensor data you see in the laser sensors does this. In matlab it would
>>>>> look something like:
>>>>>
>>>>> prevhandle = 0;
>>>>> for each laser scan
>>>>>  newhandle = orEnvPlot(newlaserdata);
>>>>>  orEnvClose(prevhandle);
>>>>>  prevhandle = newhandle;
>>>>>  pause(time_in_seconds);
>>>>> end
>>>>>
>>>>> In C++, you can create a thread in your plugin that does this so you
>>>>> don't have to worry about it. It is very important that you create the
>>>>> new laser data before deleting the old, otherwise you might get
>>>>> flickering, which might get quite annoying.
>>>>>
>>>>> If you will be using the voxel boses for collision detection, it is
>>>>> best to create them as kinbodies. If they are just for display, it is
>>>>> best to use the openrave plotting, as it will be faster.
>>>>>
>>>>> The fastest way of doing this when using kinbodies, is to create them
>>>>> all at once then add/remove them from the environment (without
>>>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>>>> done through a plugin.
>>>>>
>>>>> rosen,
>>>>>
>>>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>>>
>>>>>> Hi,
>>>>>>       I've got some <x,y,z> point cloud data that I collected from a
>>>>>> laser
>>>>>> scanner and would like to play back a sequence of saved laser scans in
>>>>>> openrave to create an animation.  What would be the recommended way for
>>>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>>>> once as maybe a set of VRML files and then make each one visible in
>>>>>> turn?  Can I make use of openrave's ability to visualize live laser
>>>>>> data
>>>>>> and instead pass in the saved data instead?
>>>>>>
>>>>>> On a related note, I'll also be generating a set of voxels around the
>>>>>> laser data and want to create/display boxes of the appropriate voxel
>>>>>> dimensions than just the individual points.  Once again I'd like to
>>>>>> play
>>>>>> back a sequence of these as per the data that I collected.  What would
>>>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>>>> made up of a set of openrave objects?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> -Paul
>>>>>>
>>>>>>
>>>>>> -------------------------------------------------------------------------
>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>>>> challenge
>>>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>>>> prizes
>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>>>> world
>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>> _______________________________________________
>>>>>> Openrave-users mailing list
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>>>
>>>
>>
>> --
>> Paul E. Rybski, Ph.D., Systems Scientist
>> The Robotics Institute, Carnegie Mellon University
>> Phone: 412-268-7417, Fax: 412-268-7350
>> Web: http://www.cs.cmu.edu/~prybski
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Paul E. Rybski
In reply to this post by Rosen Diankov-2
So essentially, since all of my voxels are identicaly, it seems that all
I would need to do is instantiate a single KinBody and then create all
the trimeshes from that where after I create them, I apply the
appropriate transformations to them as needed.

Does that sound about right?

-Paul

Rosen Diankov wrote:

> Hi Paul,
>
> To make your life easier when generating the triangles, there's a
> EnvironmentBase::Triangulate function. What you could is take the
> triangles of the KinBody and successively reproduce them to form the
> final triangles.
>
> Imagine you have all the transformations of your original bodies in
> vector<Tranform> vtrans, and pBodyOrig is the KinBody geometry you
> want reproduced. Then all you have to do is the following code:
>
> KinBody::Link::TRIMESH triorig, triall, tritemp;
> g_pEnviron->Triangulate(triorig, pBodyOrig);
> triorig.ApplyTransform(pBodyOrig->GetTransform().inverse());
>
>
> FOREACH(ittrans, vtrans) {
>     tritemp = triorig;
>     tritemp.ApplyTransform(*ittrans);
>     triall.Append(tritemp);
> }
>
> g_pEnviron->drawtrimesh(trimesh.vertices[0], sizeof(Vector),
> &trimesh.indices[0], trimesh.indices.size()/3, mycolor);
>
> I haven't run this code to double check, but it should give you an
> idea of how easy it would be to  use drawtrimesh.
>
> rosen,
>
> 2008/8/7 Paul E. Rybski <[hidden email]>:
>> Great!  I'll check it out.  Many thanks!
>>
>> I'm hoping to find the best way to try to make use of the graphics card that
>> I have in this machine.  It's an NVIDIA 8800 GTS 640M so it should be
>> capable of handling quite heavy GL stuff...
>>
>> -Paul
>>
>> Rosen Diankov wrote:
>>> Hi Paul,
>>>
>>> Sorry to hear that it is that slow, you might want to try
>>> EnvironmentBase::drawtrimesh. You can pass it all triangles of all
>>> your boxes in one call. Then when it comes time to update your scene,
>>> remove the old trimesh with EnvironmentBase::closegraph and render the
>>> new trimesh. Actually to avoid flickering, you should add the second
>>> trimesh before closing the first one.
>>>
>>> trimeshes do support transparency by setting the 4th component of the
>>> color vector to a value less than 1. If you look at the laser sensor
>>> demos by running testlasersensor, you'll see an example usage of the
>>> trimeshes
>>>
>>> rosen,
>>>
>>>
>>> 2008/8/7 Paul E. Rybski <[hidden email]>:
>>>> Hi Rosen,
>>>>       You said below that the fastest way to render my voxels is via
>>>> KinBodies.  I did this but right now, I'm shooting at like 6000 small
>>>> cubes being rendered and it's pretty slow on my 2.4GHz Q6600 Intel CPU
>>>> (quad processor).  Is this really the fastest way to render volumes like
>>>> this? Is there anything in between the fast scripted draw routines of
>>>> EnvironmentBase and KinBodies that  I might use?  I'd love to just use
>>>> the draw functions but I need the cubes I render to be the correct size
>>>> no matter how I zoom in and out of the scene with my virtual camera.
>>>>
>>>> If not, then I'll see about finding another mechanism for maybe
>>>> subsampling my data.
>>>>
>>>> -Paul
>>>>
>>>> Rosen Diankov wrote:
>>>>> Hi Paul,
>>>>>
>>>>> The best way is to use the plotting features of openrave. Just create
>>>>> a new plot for every new laser scan and destroy the old one. The live
>>>>> sensor data you see in the laser sensors does this. In matlab it would
>>>>> look something like:
>>>>>
>>>>> prevhandle = 0;
>>>>> for each laser scan
>>>>>  newhandle = orEnvPlot(newlaserdata);
>>>>>  orEnvClose(prevhandle);
>>>>>  prevhandle = newhandle;
>>>>>  pause(time_in_seconds);
>>>>> end
>>>>>
>>>>> In C++, you can create a thread in your plugin that does this so you
>>>>> don't have to worry about it. It is very important that you create the
>>>>> new laser data before deleting the old, otherwise you might get
>>>>> flickering, which might get quite annoying.
>>>>>
>>>>> If you will be using the voxel boses for collision detection, it is
>>>>> best to create them as kinbodies. If they are just for display, it is
>>>>> best to use the openrave plotting, as it will be faster.
>>>>>
>>>>> The fastest way of doing this when using kinbodies, is to create them
>>>>> all at once then add/remove them from the environment (without
>>>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>>>> done through a plugin.
>>>>>
>>>>> rosen,
>>>>>
>>>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>>> Hi,
>>>>>>       I've got some <x,y,z> point cloud data that I collected from a
>>>>>> laser
>>>>>> scanner and would like to play back a sequence of saved laser scans in
>>>>>> openrave to create an animation.  What would be the recommended way for
>>>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>>>> once as maybe a set of VRML files and then make each one visible in
>>>>>> turn?  Can I make use of openrave's ability to visualize live laser
>>>>>> data
>>>>>> and instead pass in the saved data instead?
>>>>>>
>>>>>> On a related note, I'll also be generating a set of voxels around the
>>>>>> laser data and want to create/display boxes of the appropriate voxel
>>>>>> dimensions than just the individual points.  Once again I'd like to
>>>>>> play
>>>>>> back a sequence of these as per the data that I collected.  What would
>>>>>> be a good way to play back a set of "snapshots" where each snapshot is
>>>>>> made up of a set of openrave objects?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> -Paul
>>>>>>
>>>>>>
>>>>>> -------------------------------------------------------------------------
>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>>>> challenge
>>>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>>>> prizes
>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>>>> world
>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>> _______________________________________________
>>>>>> Openrave-users mailing list
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>>>
>> --
>> Paul E. Rybski, Ph.D., Systems Scientist
>> The Robotics Institute, Carnegie Mellon University
>> Phone: 412-268-7417, Fax: 412-268-7350
>> Web: http://www.cs.cmu.edu/~prybski
>>
>

--
Paul E. Rybski, Ph.D., Systems Scientist
The Robotics Institute, Carnegie Mellon University
Phone: 412-268-7417, Fax: 412-268-7350
Web: http://www.cs.cmu.edu/~prybski


Reply | Threaded
Open this post in threaded view
|

Re: question about loading and animating a sequence of point data

Rosen Diankov-2
Yes. In fact if you are really worried about speed, you can cache the
trimeshes for each different voxel so all you have to do in the end is
TRIMESH::Append the correct ones. Don't forget to destroy the previous
drawtrimesh graph after the new one is drawn!

rosen,

2008/8/7 Paul E. Rybski <[hidden email]>:

> So essentially, since all of my voxels are identicaly, it seems that all I
> would need to do is instantiate a single KinBody and then create all the
> trimeshes from that where after I create them, I apply the appropriate
> transformations to them as needed.
>
> Does that sound about right?
>
> -Paul
>
> Rosen Diankov wrote:
>>
>> Hi Paul,
>>
>> To make your life easier when generating the triangles, there's a
>> EnvironmentBase::Triangulate function. What you could is take the
>> triangles of the KinBody and successively reproduce them to form the
>> final triangles.
>>
>> Imagine you have all the transformations of your original bodies in
>> vector<Tranform> vtrans, and pBodyOrig is the KinBody geometry you
>> want reproduced. Then all you have to do is the following code:
>>
>> KinBody::Link::TRIMESH triorig, triall, tritemp;
>> g_pEnviron->Triangulate(triorig, pBodyOrig);
>> triorig.ApplyTransform(pBodyOrig->GetTransform().inverse());
>>
>>
>> FOREACH(ittrans, vtrans) {
>>    tritemp = triorig;
>>    tritemp.ApplyTransform(*ittrans);
>>    triall.Append(tritemp);
>> }
>>
>> g_pEnviron->drawtrimesh(trimesh.vertices[0], sizeof(Vector),
>> &trimesh.indices[0], trimesh.indices.size()/3, mycolor);
>>
>> I haven't run this code to double check, but it should give you an
>> idea of how easy it would be to  use drawtrimesh.
>>
>> rosen,
>>
>> 2008/8/7 Paul E. Rybski <[hidden email]>:
>>>
>>> Great!  I'll check it out.  Many thanks!
>>>
>>> I'm hoping to find the best way to try to make use of the graphics card
>>> that
>>> I have in this machine.  It's an NVIDIA 8800 GTS 640M so it should be
>>> capable of handling quite heavy GL stuff...
>>>
>>> -Paul
>>>
>>> Rosen Diankov wrote:
>>>>
>>>> Hi Paul,
>>>>
>>>> Sorry to hear that it is that slow, you might want to try
>>>> EnvironmentBase::drawtrimesh. You can pass it all triangles of all
>>>> your boxes in one call. Then when it comes time to update your scene,
>>>> remove the old trimesh with EnvironmentBase::closegraph and render the
>>>> new trimesh. Actually to avoid flickering, you should add the second
>>>> trimesh before closing the first one.
>>>>
>>>> trimeshes do support transparency by setting the 4th component of the
>>>> color vector to a value less than 1. If you look at the laser sensor
>>>> demos by running testlasersensor, you'll see an example usage of the
>>>> trimeshes
>>>>
>>>> rosen,
>>>>
>>>>
>>>> 2008/8/7 Paul E. Rybski <[hidden email]>:
>>>>>
>>>>> Hi Rosen,
>>>>>      You said below that the fastest way to render my voxels is via
>>>>> KinBodies.  I did this but right now, I'm shooting at like 6000 small
>>>>> cubes being rendered and it's pretty slow on my 2.4GHz Q6600 Intel CPU
>>>>> (quad processor).  Is this really the fastest way to render volumes
>>>>> like
>>>>> this? Is there anything in between the fast scripted draw routines of
>>>>> EnvironmentBase and KinBodies that  I might use?  I'd love to just use
>>>>> the draw functions but I need the cubes I render to be the correct size
>>>>> no matter how I zoom in and out of the scene with my virtual camera.
>>>>>
>>>>> If not, then I'll see about finding another mechanism for maybe
>>>>> subsampling my data.
>>>>>
>>>>> -Paul
>>>>>
>>>>> Rosen Diankov wrote:
>>>>>>
>>>>>> Hi Paul,
>>>>>>
>>>>>> The best way is to use the plotting features of openrave. Just create
>>>>>> a new plot for every new laser scan and destroy the old one. The live
>>>>>> sensor data you see in the laser sensors does this. In matlab it would
>>>>>> look something like:
>>>>>>
>>>>>> prevhandle = 0;
>>>>>> for each laser scan
>>>>>>  newhandle = orEnvPlot(newlaserdata);
>>>>>>  orEnvClose(prevhandle);
>>>>>>  prevhandle = newhandle;
>>>>>>  pause(time_in_seconds);
>>>>>> end
>>>>>>
>>>>>> In C++, you can create a thread in your plugin that does this so you
>>>>>> don't have to worry about it. It is very important that you create the
>>>>>> new laser data before deleting the old, otherwise you might get
>>>>>> flickering, which might get quite annoying.
>>>>>>
>>>>>> If you will be using the voxel boses for collision detection, it is
>>>>>> best to create them as kinbodies. If they are just for display, it is
>>>>>> best to use the openrave plotting, as it will be faster.
>>>>>>
>>>>>> The fastest way of doing this when using kinbodies, is to create them
>>>>>> all at once then add/remove them from the environment (without
>>>>>> deallocating their resources) using EnvironmentBase::AddKinBody(pbody)
>>>>>> and EnvironmentBase::RemoveKinBody(pbody, false). This can only be
>>>>>> done through a plugin.
>>>>>>
>>>>>> rosen,
>>>>>>
>>>>>> 2008/7/28 Paul E. Rybski <[hidden email]>:
>>>>>>>
>>>>>>> Hi,
>>>>>>>      I've got some <x,y,z> point cloud data that I collected from a
>>>>>>> laser
>>>>>>> scanner and would like to play back a sequence of saved laser scans
>>>>>>> in
>>>>>>> openrave to create an animation.  What would be the recommended way
>>>>>>> for
>>>>>>> me to do this?  Can I load the entire laser sequence into openrave at
>>>>>>> once as maybe a set of VRML files and then make each one visible in
>>>>>>> turn?  Can I make use of openrave's ability to visualize live laser
>>>>>>> data
>>>>>>> and instead pass in the saved data instead?
>>>>>>>
>>>>>>> On a related note, I'll also be generating a set of voxels around the
>>>>>>> laser data and want to create/display boxes of the appropriate voxel
>>>>>>> dimensions than just the individual points.  Once again I'd like to
>>>>>>> play
>>>>>>> back a sequence of these as per the data that I collected.  What
>>>>>>> would
>>>>>>> be a good way to play back a set of "snapshots" where each snapshot
>>>>>>> is
>>>>>>> made up of a set of openrave objects?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> -Paul
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -------------------------------------------------------------------------
>>>>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>>>>> challenge
>>>>>>> Build the coolest Linux based applications with Moblin SDK & win
>>>>>>> great
>>>>>>> prizes
>>>>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>>>>> world
>>>>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>>>>> _______________________________________________
>>>>>>> Openrave-users mailing list
>>>>>>> [hidden email]
>>>>>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>>>>>
>>> --
>>> Paul E. Rybski, Ph.D., Systems Scientist
>>> The Robotics Institute, Carnegie Mellon University
>>> Phone: 412-268-7417, Fax: 412-268-7350
>>> Web: http://www.cs.cmu.edu/~prybski
>>>
>>
>
> --
> Paul E. Rybski, Ph.D., Systems Scientist
> The Robotics Institute, Carnegie Mellon University
> Phone: 412-268-7417, Fax: 412-268-7350
> Web: http://www.cs.cmu.edu/~prybski
>