pcl::visualization::KeyboardEvent::KeyboardEvent documentation

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

pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Martijn Van Loocke
I know PCL1.1 was released on a few days ago but I would like to be able
to use the functions in the keyboardEvent class. I can't find any
examples that use it. The only documentation that i can find is
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html 
but I'm a novice and I have no clue how to read those kind of pages.

Are there any examples that use the keyboardEvent class in a
PCLVisualizer program?

If anyone knows a website that explains how to read reference pages such
as the one above.

-Martijn
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Radu B. Rusu
Administrator
Martijn,

There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.

Cheers,
Radu.
--
Point Cloud Library (PCL) - http://pointclouds.org

On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:

> I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
> class. I can't find any examples that use it. The only documentation that i can find is
> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
> how to read those kind of pages.
>
> Are there any examples that use the keyboardEvent class in a PCLVisualizer program?
>
> If anyone knows a website that explains how to read reference pages such as the one above.
>
> -Martijn
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

aichim
Administrator
Hello Martijn,

A very simple example for you:


void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event)
{
  if (event.keyDown () && event.getKeyCode() == ' ')
  {
// do cool stuff when SPACE was pressed
  }
}
(...)
p = new pcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
p->registerKeyboardCallback(keyboardEventOccurred);
(...)


Cheers,
Alex


--
Alexandru - Eugen Ichim
====================
MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
BSc Electrical Engineering and Computer Science @ Jacobs University




On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:

Martijn,

There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.

Cheers,
Radu.
--
Point Cloud Library (PCL) - http://pointclouds.org

On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
class. I can't find any examples that use it. The only documentation that i can find is
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
how to read those kind of pages.

Are there any examples that use the keyboardEvent class in a PCLVisualizer program?

If anyone knows a website that explains how to read reference pages such as the one above.

-Martijn
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users





_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Martijn Van Loocke
Thanks Alex,

That exactly what I as looking for!
I think a simple example like that should be part of every reference page to make it easier for people who are not used to using such reference pages to write the code they want.

If anyone knows a tutorial about how to use reference pages properly, I would still be very interested to see it.

-Martijn

On 28/07/11 19:32, Alexandru-Eugen Ichim wrote:
Hello Martijn,

A very simple example for you:


void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event)
{
  if (event.keyDown () && event.getKeyCode() == ' ')
  {
// do cool stuff when SPACE was pressed
  }
}
(...)
p = new pcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
p->registerKeyboardCallback(keyboardEventOccurred);
(...)


Cheers,
Alex


--
Alexandru - Eugen Ichim
====================
MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
BSc Electrical Engineering and Computer Science @ Jacobs University




On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:

Martijn,

There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.

Cheers,
Radu.
--
Point Cloud Library (PCL) - http://pointclouds.org

On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
class. I can't find any examples that use it. The only documentation that i can find is
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
how to read those kind of pages.

Are there any examples that use the keyboardEvent class in a PCLVisualizer program?

If anyone knows a website that explains how to read reference pages such as the one above.

-Martijn
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users




_______________________________________________ [hidden email] / http://pointclouds.org http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Radu B. Rusu
Administrator
Alex,

Should just add this to the Doxygen API documentation? :)

Cheers,
Radu.
--
Point Cloud Library (PCL) - http://pointclouds.org

On 07/28/2011 12:23 PM, Martijn Van Loocke wrote:

> Thanks Alex,
>
> That exactly what I as looking for!
> I think a simple example like that should be part of every reference page to make it easier for people who are not used
> to using such reference pages to write the code they want.
>
> If anyone knows a tutorial about how to use reference pages properly, I would still be very interested to see it.
>
> -Martijn
>
> On 28/07/11 19:32, Alexandru-Eugen Ichim wrote:
>> Hello Martijn,
>>
>> A very simple example for you:
>>
>>
>> voidkeyboardEventOccurred (constpcl::visualization::KeyboardEvent&event)
>> {
>> if(event.keyDown () && event.getKeyCode() == ' ')
>> {
>> // do cool stuff when SPACE was pressed
>> }
>> }
>> (...)
>> p = newpcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
>> p->registerKeyboardCallback(keyboardEventOccurred);
>> (...)
>>
>>
>> Cheers,
>> Alex
>>
>>
>> --
>> Alexandru - Eugen Ichim
>> http://www.alexichim.com
>> ====================
>> MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
>> BSc Electrical Engineering and Computer Science @ Jacobs University
>>
>>
>>
>>
>> On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:
>>
>>> Martijn,
>>>
>>> There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in
>>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.
>>>
>>> Cheers,
>>> Radu.
>>> --
>>> Point Cloud Library (PCL) - http://pointclouds.org
>>>
>>> On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
>>>> I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
>>>> class. I can't find any examples that use it. The only documentation that i can find is
>>>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
>>>> how to read those kind of pages.
>>>>
>>>> Are there any examples that use the keyboardEvent class in a PCLVisualizer program?
>>>>
>>>> If anyone knows a website that explains how to read reference pages such as the one above.
>>>>
>>>> -Martijn
>>>> _______________________________________________
>>>> [hidden email] <mailto:[hidden email]> / http://pointclouds.org
>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>> _______________________________________________
>>> [hidden email] <mailto:[hidden email]> / http://pointclouds.org
>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>
>>
>>
>>
>>
>> _______________________________________________
>> [hidden email]  /http://pointclouds.org
>> http://pointclouds.org/mailman/listinfo/pcl-users
>
>
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

aichim
Administrator
Sir, yes Sir!

I will also modify the PCLVisualizer tutorial and add a longer explanation there (including mouse events). Sounds good?

Alex

On Jul 28, 2011, at 10:26 PM, Radu B. Rusu wrote:

> Alex,
>
> Should just add this to the Doxygen API documentation? :)
>
> Cheers,
> Radu.
> --
> Point Cloud Library (PCL) - http://pointclouds.org
>
> On 07/28/2011 12:23 PM, Martijn Van Loocke wrote:
>> Thanks Alex,
>>
>> That exactly what I as looking for!
>> I think a simple example like that should be part of every reference page to make it easier for people who are not used
>> to using such reference pages to write the code they want.
>>
>> If anyone knows a tutorial about how to use reference pages properly, I would still be very interested to see it.
>>
>> -Martijn
>>
>> On 28/07/11 19:32, Alexandru-Eugen Ichim wrote:
>>> Hello Martijn,
>>>
>>> A very simple example for you:
>>>
>>>
>>> voidkeyboardEventOccurred (constpcl::visualization::KeyboardEvent&event)
>>> {
>>> if(event.keyDown () && event.getKeyCode() == ' ')
>>> {
>>> // do cool stuff when SPACE was pressed
>>> }
>>> }
>>> (...)
>>> p = newpcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
>>> p->registerKeyboardCallback(keyboardEventOccurred);
>>> (...)
>>>
>>>
>>> Cheers,
>>> Alex
>>>
>>>
>>> --
>>> Alexandru - Eugen Ichim
>>> http://www.alexichim.com
>>> ====================
>>> MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
>>> BSc Electrical Engineering and Computer Science @ Jacobs University
>>>
>>>
>>>
>>>
>>> On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:
>>>
>>>> Martijn,
>>>>
>>>> There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in
>>>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.
>>>>
>>>> Cheers,
>>>> Radu.
>>>> --
>>>> Point Cloud Library (PCL) - http://pointclouds.org
>>>>
>>>> On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
>>>>> I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
>>>>> class. I can't find any examples that use it. The only documentation that i can find is
>>>>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
>>>>> how to read those kind of pages.
>>>>>
>>>>> Are there any examples that use the keyboardEvent class in a PCLVisualizer program?
>>>>>
>>>>> If anyone knows a website that explains how to read reference pages such as the one above.
>>>>>
>>>>> -Martijn
>>>>> _______________________________________________
>>>>> [hidden email] <mailto:[hidden email]> / http://pointclouds.org
>>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>> _______________________________________________
>>>> [hidden email] <mailto:[hidden email]> / http://pointclouds.org
>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> [hidden email]  /http://pointclouds.org
>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>
>>
>> _______________________________________________
>> [hidden email] / http://pointclouds.org
>> http://pointclouds.org/mailman/listinfo/pcl-users
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Martijn Van Loocke
In reply to this post by aichim
Until now I have been using pcl_visualization/visualizer.h for the ros installation instead of pcl/visualization/visualizer.h from the standalone PCL installation because whenever I try to use the second one, there is something wrong with the references in the header files of the PCL package. Now i really need to use PCL1.1 which is not part of ros, so I use:

    #include <pcl/visualization/pcl_visualizer.h> (after making a symbolic link to pcl1.1 in the include folder)

I get the following errors, making it impossible to compile:


/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp: In member function ‘virtual void pcl::visualization::PointCloudColorHandlerRandom<PointT>::getColor(vtkSmartPointer<vtkDataArray>&) const’:
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:85:3: error: ‘getRandomColors’ is not a member of ‘pcl::visualization’
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:32: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:32: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:60: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:88: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available

Whenever i have used examples with visualizer from the internet, I have gotten errors like this. Is there a fix for this? None of the errors are from my code, they result from including pcl/visualization/pcl_visualizer.h

-Martijn

On 28/07/11 19:32, Alexandru-Eugen Ichim wrote:
Hello Martijn,

A very simple example for you:


void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event)
{
  if (event.keyDown () && event.getKeyCode() == ' ')
  {
// do cool stuff when SPACE was pressed
  }
}
(...)
p = new pcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
p->registerKeyboardCallback(keyboardEventOccurred);
(...)


Cheers,
Alex


--
Alexandru - Eugen Ichim
====================
MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
BSc Electrical Engineering and Computer Science @ Jacobs University




On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:

Martijn,

There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.

Cheers,
Radu.
--
Point Cloud Library (PCL) - http://pointclouds.org

On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
class. I can't find any examples that use it. The only documentation that i can find is
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
how to read those kind of pages.

Are there any examples that use the keyboardEvent class in a PCLVisualizer program?

If anyone knows a website that explains how to read reference pages such as the one above.

-Martijn
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users




_______________________________________________ [hidden email] / http://pointclouds.org http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Martijn Van Loocke
I had compiled it with rosmake. There are a lot more errors that were not shown. Here is the complete list of error generated by make with the following source code:

    #include <pcl/visualization/pcl_visualizer.h>

    int main (int argc, char **argv)
    {
        return 0;
    }

and the errors:


/usr/include/pcl/console/print.h:90:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:94:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:98:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:102:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:111:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:119:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:125:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:134:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:140:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:147:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:153:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:160:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:166:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:173:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:179:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:186:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:192:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:199:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:206:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:213:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:221:5: error: ‘PCL_EXPORTS’ does not name a type
/usr/include/pcl/console/print.h:228:5: error: ‘PCL_EXPORTS’ does not name a type
In file included from /usr/include/pcl/visualization/point_cloud_handlers.h:40:0,
                 from /usr/include/pcl/visualization/common/actor_map.h:40,
                 from /usr/include/pcl/visualization/interactor_style.h:63,
                 from /usr/include/pcl/visualization/pcl_visualizer.h:47,
                 from /home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:1:
/usr/include/pcl/visualization/common/common.h:55:5: error: ‘PCL_EXPORTS’ does not name a type
In file included from /usr/include/pcl/visualization/common/actor_map.h:40:0,
                 from /usr/include/pcl/visualization/interactor_style.h:63,
                 from /usr/include/pcl/visualization/pcl_visualizer.h:47,
                 from /home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:1:
/usr/include/pcl/visualization/point_cloud_handlers.h:253:5: error: invalid declarator before ‘{’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:314:78: error: invalid declarator before ‘:’ token
In file included from /usr/include/pcl/visualization/common/actor_map.h:40:0,
                 from /usr/include/pcl/visualization/interactor_style.h:63,
                 from /usr/include/pcl/visualization/pcl_visualizer.h:47,
                 from /home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:1:
/usr/include/pcl/visualization/point_cloud_handlers.h:341:88: error: invalid declarator before ‘:’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:368:81: error: invalid declarator before ‘:’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:629:5: error: invalid declarator before ‘{’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:679:78: error: invalid declarator before ‘:’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:716:78: error: invalid declarator before ‘:’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:758:80: error: invalid declarator before ‘:’ token
/usr/include/pcl/visualization/point_cloud_handlers.h:792:84: error: invalid declarator before ‘:’ token
In file included from /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:38:0,
                 from /usr/include/pcl/visualization/point_cloud_handlers.h:829,
                 from /usr/include/pcl/visualization/common/actor_map.h:40,
                 from /usr/include/pcl/visualization/interactor_style.h:63,
                 from /usr/include/pcl/visualization/pcl_visualizer.h:47,
                 from /home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:1:
/usr/include/pcl/console/time.h: In member function ‘void pcl::console::TicToc::toc_print()’:
/usr/include/pcl/console/time.h:69:39: error: ‘print_value’ was not declared in this scope
/usr/include/pcl/console/time.h:70:37: error: ‘print_info’ was not declared in this scope
/usr/include/pcl/console/time.h:72:37: error: ‘print_value’ was not declared in this scope
/usr/include/pcl/console/time.h:73:35: error: ‘print_info’ was not declared in this scope
In file included from /usr/include/pcl/visualization/point_cloud_handlers.h:829:0,
                 from /usr/include/pcl/visualization/common/actor_map.h:40,
                 from /usr/include/pcl/visualization/interactor_style.h:63,
                 from /usr/include/pcl/visualization/pcl_visualizer.h:47,
                 from /home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:1:
/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp: In member function ‘virtual void pcl::visualization::PointCloudColorHandlerRandom<PointT>::getColor(vtkSmartPointer<vtkDataArray>&) const’:
/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:85:3: error: ‘getRandomColors’ is not a member of ‘pcl::visualization’
/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:32: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:32: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:60: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:88: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
In file included from /usr/include/pcl/visualization/pcl_visualizer.h:47:0,
                 from /home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:1:
/usr/include/pcl/visualization/interactor_style.h: At global scope:
/usr/include/pcl/visualization/interactor_style.h:79:52: error: expected initializer before ‘:’ token
/home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:6:1: error: expected ‘}’ at end of input
/home/martijn/ros_tutorials/kinectPCLTest/src/kinectPCLTest.cpp:6:1: error: expected ‘}’ at end of input

I really need a solution to this urgently. I installed the package with the synaptic package manager so everything is installed in the default location.

-Martijn


On 29/07/11 10:04, Martijn Van Loocke wrote:
Until now I have been using pcl_visualization/visualizer.h for the ros installation instead of pcl/visualization/visualizer.h from the standalone PCL installation because whenever I try to use the second one, there is something wrong with the references in the header files of the PCL package. Now i really need to use PCL1.1 which is not part of ros, so I use:

    #include <pcl/visualization/pcl_visualizer.h> (after making a symbolic link to pcl1.1 in the include folder)

I get the following errors, making it impossible to compile:


/usr/include/pcl/visualization/impl/point_cloud_handlers.hpp: In member function ‘virtual void pcl::visualization::PointCloudColorHandlerRandom<PointT>::getColor(vtkSmartPointer<vtkDataArray>&) const’:
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:85:3: error: ‘getRandomColors’ is not a member of ‘pcl::visualization’
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:32: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:32: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:60: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available
  /usr/include/pcl/visualization/impl/point_cloud_handlers.hpp:87:88: error: there are no arguments to ‘pcl_lrint’ that depend on a template parameter, so a declaration of ‘pcl_lrint’ must be available

Whenever i have used examples with visualizer from the internet, I have gotten errors like this. Is there a fix for this? None of the errors are from my code, they result from including pcl/visualization/pcl_visualizer.h

-Martijn

On 28/07/11 19:32, Alexandru-Eugen Ichim wrote:
Hello Martijn,

A very simple example for you:


void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event)
{
  if (event.keyDown () && event.getKeyCode() == ' ')
  {
// do cool stuff when SPACE was pressed
  }
}
(...)
p = new pcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
p->registerKeyboardCallback(keyboardEventOccurred);
(...)


Cheers,
Alex


--
Alexandru - Eugen Ichim
====================
MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
BSc Electrical Engineering and Computer Science @ Jacobs University




On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:

Martijn,

There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.

Cheers,
Radu.
--
Point Cloud Library (PCL) - http://pointclouds.org

On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
class. I can't find any examples that use it. The only documentation that i can find is
http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
how to read those kind of pages.

Are there any examples that use the keyboardEvent class in a PCLVisualizer program?

If anyone knows a website that explains how to read reference pages such as the one above.

-Martijn
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users




_______________________________________________ [hidden email] / http://pointclouds.org http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pcl::visualization::KeyboardEvent::KeyboardEvent documentation

Martijn Van Loocke
In reply to this post by aichim
The code in your example did not work for me (probably because I use it
in a class). This code does work however:

class kinectCloud
{
     public:
         pcl::visualization::PCLVisualizer* viewer;

         kinectCloud(){
             viewer = new pcl::visualization::PCLVisualizer("3D Viewer");
             
viewer->registerKeyboardCallback(&kinectCloud::keyboardEventOccurred,
*this, 0);
         }

         ~kinectCloud(){
             delete viewer;
         }

         void keyboardEventOccurred (const
pcl::visualization::KeyboardEvent &event, void *){
             if (event.keyDown () && event.getKeyCode() == ' '){
                 cout << "Space pressed" << endl;
             }
         }
}

-Martijn

On 29/07/11 00:06, Alexandru-Eugen Ichim wrote:

> Sir, yes Sir!
>
> I will also modify the PCLVisualizer tutorial and add a longer explanation there (including mouse events). Sounds good?
>
> Alex
>
> On Jul 28, 2011, at 10:26 PM, Radu B. Rusu wrote:
>
>> Alex,
>>
>> Should just add this to the Doxygen API documentation? :)
>>
>> Cheers,
>> Radu.
>> --
>> Point Cloud Library (PCL) - http://pointclouds.org
>>
>> On 07/28/2011 12:23 PM, Martijn Van Loocke wrote:
>>> Thanks Alex,
>>>
>>> That exactly what I as looking for!
>>> I think a simple example like that should be part of every reference page to make it easier for people who are not used
>>> to using such reference pages to write the code they want.
>>>
>>> If anyone knows a tutorial about how to use reference pages properly, I would still be very interested to see it.
>>>
>>> -Martijn
>>>
>>> On 28/07/11 19:32, Alexandru-Eugen Ichim wrote:
>>>> Hello Martijn,
>>>>
>>>> A very simple example for you:
>>>>
>>>>
>>>> voidkeyboardEventOccurred (constpcl::visualization::KeyboardEvent&event)
>>>> {
>>>> if(event.keyDown ()&&  event.getKeyCode() == ' ')
>>>> {
>>>> // do cool stuff when SPACE was pressed
>>>> }
>>>> }
>>>> (...)
>>>> p = newpcl::visualization::PCLVisualizer (argc, argv, "OpenNI Viewer");
>>>> p->registerKeyboardCallback(keyboardEventOccurred);
>>>> (...)
>>>>
>>>>
>>>> Cheers,
>>>> Alex
>>>>
>>>>
>>>> --
>>>> Alexandru - Eugen Ichim
>>>> http://www.alexichim.com
>>>> ====================
>>>> MSc Computer Science @ Ecole Polytechnique Fédérale de Lausanne
>>>> BSc Electrical Engineering and Computer Science @ Jacobs University
>>>>
>>>>
>>>>
>>>>
>>>> On Jul 28, 2011, at 8:27 PM, Radu B. Rusu wrote:
>>>>
>>>>> Martijn,
>>>>>
>>>>> There are no tutorials yet, but there will be soon. In principle, all you have to do is look at the methods in
>>>>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html to see how to register a new event.
>>>>>
>>>>> Cheers,
>>>>> Radu.
>>>>> --
>>>>> Point Cloud Library (PCL) - http://pointclouds.org
>>>>>
>>>>> On 07/28/2011 05:33 AM, Martijn Van Loocke wrote:
>>>>>> I know PCL1.1 was released on a few days ago but I would like to be able to use the functions in the keyboardEvent
>>>>>> class. I can't find any examples that use it. The only documentation that i can find is
>>>>>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_keyboard_event.html but I'm a novice and I have no clue
>>>>>> how to read those kind of pages.
>>>>>>
>>>>>> Are there any examples that use the keyboardEvent class in a PCLVisualizer program?
>>>>>>
>>>>>> If anyone knows a website that explains how to read reference pages such as the one above.
>>>>>>
>>>>>> -Martijn
>>>>>> _______________________________________________
>>>>>> [hidden email]<mailto:[hidden email]>  / http://pointclouds.org
>>>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>>> _______________________________________________
>>>>> [hidden email]<mailto:[hidden email]>  / http://pointclouds.org
>>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> [hidden email]  /http://pointclouds.org
>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>
>>> _______________________________________________
>>> [hidden email] / http://pointclouds.org
>>> http://pointclouds.org/mailman/listinfo/pcl-users
>> _______________________________________________
>> [hidden email] / http://pointclouds.org
>> http://pointclouds.org/mailman/listinfo/pcl-users
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users