To disable this dialog, set the DISABLE_ROS1_EOL_WARNINGS environment "
16 | "variable.
");
17 | setWindowTitle("ROS 1 End-of-Life is May 31st, 2025");
18 | setStandardButtons(QMessageBox::Ok);
19 | }
20 | } // end namespace rviz
21 |
--------------------------------------------------------------------------------
/src/rviz/noetic_eol_dialog.h:
--------------------------------------------------------------------------------
1 | #ifndef RVIZ_NOETIC_EOL_DIALOG_H
2 | #define RVIZ_NOETIC_EOL_DIALOG_H
3 |
4 | #include
5 |
6 | namespace rviz
7 | {
8 | class NoeticEOLDialog : public QMessageBox
9 | {
10 | Q_OBJECT
11 | public:
12 | NoeticEOLDialog(QWidget* parent = nullptr);
13 | };
14 |
15 | } // end namespace rviz
16 |
17 | #endif // RVIZ_WAIT_FOR_MASTER_DIALOG_H
18 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/apply_visibility_bits.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef APPLY_VISIBILITY_BITS_H
30 | #define APPLY_VISIBILITY_BITS_H
31 |
32 | namespace Ogre
33 | {
34 | class SceneNode;
35 | }
36 |
37 | namespace rviz
38 | {
39 | void applyVisibilityBits(uint32_t bits, Ogre::SceneNode* node);
40 |
41 | } // end namespace rviz
42 |
43 | #endif // APPLY_VISIBILITY_BITS_H
44 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/initialization.cpp:
--------------------------------------------------------------------------------
1 | #include "initialization.h"
2 |
3 | #include
4 | #include
5 |
6 | #include
7 | #include
8 |
9 | #include
10 |
11 | namespace rviz
12 | {
13 | void cleanupOgre()
14 | {
15 | delete Ogre::Root::getSingletonPtr();
16 | }
17 |
18 | // This should be folded into RenderSystem, but it should work fine as
19 | // is, so I'm leaving it for now.
20 | void initializeResources(const V_string& resource_paths)
21 | {
22 | V_string::const_iterator path_it = resource_paths.begin();
23 | V_string::const_iterator path_end = resource_paths.end();
24 | for (; path_it != path_end; ++path_it)
25 | {
26 | Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
27 | *path_it, "FileSystem", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
28 | }
29 |
30 | Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
31 | }
32 |
33 | } // namespace rviz
34 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/initialization.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef OGRE_TOOLS_INITIALIZATION_H
31 | #define OGRE_TOOLS_INITIALIZATION_H
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | namespace rviz
38 | {
39 | typedef std::vector V_string;
40 | void cleanupOgre();
41 | void initializeResources(const V_string& resource_paths);
42 |
43 | } // namespace rviz
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/object.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include "object.h"
31 |
32 | namespace rviz
33 | {
34 | Object::Object(Ogre::SceneManager* scene_manager) : scene_manager_(scene_manager)
35 | {
36 | }
37 |
38 | } // namespace rviz
39 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/ogre_vector.h:
--------------------------------------------------------------------------------
1 | // OgrePrerequisites.h is needed for version_check to work
2 | #include
3 | #include
4 | #if OGRE_VERSION < OGRE_VERSION_CHECK(1, 12, 0)
5 | #include
6 | #else
7 | #include
8 | #endif
9 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/orthographic.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef OGRE_TOOLS_ORTHOGRAPHIC_H
31 | #define OGRE_TOOLS_ORTHOGRAPHIC_H
32 |
33 | namespace Ogre
34 | {
35 | class Matrix4;
36 | }
37 |
38 | namespace rviz
39 | {
40 | void buildScaledOrthoMatrix(Ogre::Matrix4& proj,
41 | float left,
42 | float right,
43 | float bottom,
44 | float top,
45 | float near,
46 | float far);
47 | }
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/src/rviz/ogre_helpers/version_check.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Bielefeld University
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of Bielefeld University nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef OGRE_HELPERS_VERSION_CHECK_H
30 | #define OGRE_HELPERS_VERSION_CHECK_H
31 |
32 | // For use like #if (OGRE_VERSION >= OGRE_VERSION_CHECK(1, 9, 0))
33 | #define OGRE_VERSION_CHECK(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
34 |
35 | #endif // OGRE_HELPERS_VERSION_CHECK_H
36 |
--------------------------------------------------------------------------------
/src/rviz/panel_factory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef PANEL_FACTORY_H
30 | #define PANEL_FACTORY_H
31 |
32 | #include
33 | #include
34 |
35 | namespace rviz
36 | {
37 | class PanelFactory : public PluginlibFactory
38 | {
39 | public:
40 | PanelFactory();
41 | };
42 |
43 | } // end namespace rviz
44 |
45 | #endif // PANEL_FACTORY_H
46 |
--------------------------------------------------------------------------------
/src/rviz/preferences.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018, Open Source Robotics Foundation, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef RVIZ_PREFERENCES_H
31 | #define RVIZ_PREFERENCES_H
32 |
33 | namespace rviz
34 | {
35 | struct Preferences
36 | {
37 | bool prompt_save_on_exit = true;
38 | };
39 |
40 | } // namespace rviz
41 |
42 | #endif // RVIZ_PREFERENCES_H
43 |
--------------------------------------------------------------------------------
/src/rviz/properties/combo_box.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 | #include
32 |
33 | namespace rviz
34 | {
35 | // allow popup list to become larger than QCombBox itself
36 | void ComboBox::showPopup()
37 | {
38 | auto view = this->view();
39 | view->setMinimumWidth(view->sizeHintForColumn(0));
40 | QComboBox::showPopup();
41 | }
42 |
43 | } // end namespace rviz
44 |
--------------------------------------------------------------------------------
/src/rviz/properties/combo_box.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef COMBO_BOX_H
30 | #define COMBO_BOX_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class ComboBox : public QComboBox
37 | {
38 | Q_OBJECT
39 | Q_PROPERTY(QString currentText READ currentText USER true)
40 | public:
41 | using QComboBox::QComboBox;
42 | void showPopup() override;
43 | };
44 |
45 | } // end namespace rviz
46 |
47 | #endif // COMBO_BOX_H
48 |
--------------------------------------------------------------------------------
/src/rviz/properties/editable_combo_box.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef EDITABLE_COMBO_BOX_H
30 | #define EDITABLE_COMBO_BOX_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class EditableComboBox : public ComboBox
37 | {
38 | Q_OBJECT
39 | public:
40 | EditableComboBox(QWidget* parent = nullptr);
41 |
42 | protected:
43 | /** @brief If event is a tab key press, set the edit text to the
44 | * longest common prefix from the completer. */
45 | bool event(QEvent* event) override;
46 | };
47 |
48 | } // end namespace rviz
49 |
50 | #endif // EDITABLE_COMBO_BOX_H
51 |
--------------------------------------------------------------------------------
/src/rviz/properties/float_edit.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef FLOAT_EDIT_H
30 | #define FLOAT_EDIT_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class FloatEdit : public QLineEdit
37 | {
38 | Q_OBJECT
39 | Q_PROPERTY(float value READ getValue WRITE setValue USER true)
40 | public:
41 | FloatEdit(QWidget* parent = nullptr);
42 | virtual float getValue()
43 | {
44 | return value_;
45 | }
46 | virtual void setValue(float new_value);
47 |
48 | private Q_SLOTS:
49 | void updateValue();
50 |
51 | private:
52 | float value_;
53 | };
54 |
55 | } // end namespace rviz
56 |
57 | #endif // FLOAT_EDIT_H
58 |
--------------------------------------------------------------------------------
/src/rviz/properties/parse_color.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef PARSE_COLOR_H
30 | #define PARSE_COLOR_H
31 |
32 | #include
33 | #include
34 |
35 | #include
36 |
37 | namespace rviz
38 | {
39 | QColor parseColor(const QString& color_string);
40 | QString printColor(const QColor& color);
41 | QColor ogreToQt(const Ogre::ColourValue& ogre_color);
42 | Ogre::ColourValue qtToOgre(const QColor& qt_color);
43 |
44 | } // end namespace rviz
45 |
46 | #endif // PARSE_COLOR_H
47 |
--------------------------------------------------------------------------------
/src/rviz/properties/string_property.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 |
32 | namespace rviz
33 | {
34 | StringProperty::StringProperty(const QString& name,
35 | const QString& default_value,
36 | const QString& description,
37 | Property* parent)
38 | : Property(name, default_value, description, parent)
39 | {
40 | }
41 |
42 | } // end namespace rviz
43 |
--------------------------------------------------------------------------------
/src/rviz/selection_panel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef RVIZ_SELECTION_PANEL_H
31 | #define RVIZ_SELECTION_PANEL_H
32 |
33 | #include
34 |
35 | namespace rviz
36 | {
37 | class PropertyTreeWidget;
38 |
39 | class SelectionPanel : public Panel
40 | {
41 | Q_OBJECT
42 | public:
43 | SelectionPanel(QWidget* parent = nullptr);
44 |
45 | void onInitialize() override;
46 |
47 | private:
48 | PropertyTreeWidget* tree_widget_;
49 | };
50 |
51 | } // namespace rviz
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/src/rviz/splash_screen.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef RVIZ_SPLASH_SCREEN_H
31 | #define RVIZ_SPLASH_SCREEN_H
32 |
33 | #include
34 |
35 |
36 | class QPainter;
37 |
38 | namespace rviz
39 | {
40 | class SplashScreen : public QSplashScreen
41 | {
42 | Q_OBJECT
43 | public:
44 | SplashScreen(const QPixmap& pixmap);
45 |
46 | public Q_SLOTS:
47 | void showMessage(const QString& message);
48 | };
49 |
50 | } // end namespace rviz
51 |
52 | #endif // RVIZ_SPLASH_SCREEN_H
53 |
--------------------------------------------------------------------------------
/src/rviz/wait_for_master_dialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef RVIZ_WAIT_FOR_MASTER_DIALOG_H
30 | #define RVIZ_WAIT_FOR_MASTER_DIALOG_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class WaitForMasterDialog : public QMessageBox
37 | {
38 | Q_OBJECT
39 | public:
40 | WaitForMasterDialog(QWidget* parent = nullptr);
41 |
42 | private Q_SLOTS:
43 | void onTimer();
44 | };
45 |
46 | } // end namespace rviz
47 |
48 | #endif // RVIZ_WAIT_FOR_MASTER_DIALOG_H
49 |
--------------------------------------------------------------------------------
/src/rviz/widget_geometry_change_detector.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | WidgetGeometryChangeDetector::WidgetGeometryChangeDetector(QObject* parent) : QObject(parent)
37 | {
38 | }
39 |
40 | bool WidgetGeometryChangeDetector::eventFilter(QObject* watched, QEvent* event)
41 | {
42 | if (event->type() == QEvent::Move || event->type() == QEvent::Resize)
43 | {
44 | Q_EMIT changed();
45 | }
46 | return QObject::eventFilter(watched, event);
47 | }
48 |
49 | } // end namespace rviz
50 |
--------------------------------------------------------------------------------
/src/rviz/windows_compat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021, Tobias Fischer, Queensland University of Technology
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Queensland Uni of Technology nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef WINDOWS_COMPAT_H
31 | #define WINDOWS_COMPAT_H
32 |
33 | #ifdef _WIN32
34 |
35 | #ifdef ERROR
36 | #undef ERROR
37 | #endif
38 |
39 | #ifdef DELETE
40 | #undef DELETE
41 | #endif
42 |
43 | #endif // _WIN32
44 |
45 | #endif // WINDOWS_COMPAT_H
46 |
--------------------------------------------------------------------------------
/src/test/big-font.style:
--------------------------------------------------------------------------------
1 | * {
2 | font: 30px;
3 | }
4 |
--------------------------------------------------------------------------------
/src/test/big-menus.style:
--------------------------------------------------------------------------------
1 | QMenu::item {
2 | padding: 20px;
3 | color: white;
4 | }
5 |
6 | QMenu::item:selected {
7 | background: #6a5b54;
8 | }
9 |
--------------------------------------------------------------------------------
/src/test/color_editor_test.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 |
32 | #include
33 | #include
34 |
35 | using namespace rviz;
36 |
37 | int main(int argc, char** argv)
38 | {
39 | QApplication app(argc, argv);
40 |
41 | ColorProperty prop("foo");
42 | ColorEditor ce(&prop);
43 | ce.setText(prop.getName());
44 | ce.resize(200, 40);
45 | ce.show();
46 |
47 | return app.exec();
48 | }
49 |
--------------------------------------------------------------------------------
/src/test/cycling_frame.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # Test script to publish a "cycling_frame" that rotates about the origin
3 |
4 | import math
5 | import rospy
6 | import tf2_ros
7 | import geometry_msgs.msg
8 |
9 | rospy.init_node("tf2_cycling_frame_broadcaster")
10 | broadcaster = tf2_ros.TransformBroadcaster()
11 | rate = rospy.Rate(30)
12 |
13 | msg = geometry_msgs.msg.TransformStamped()
14 | msg.header.frame_id = "base_link"
15 | msg.child_frame_id = "cycling_frame"
16 | t = 0
17 |
18 | while not rospy.is_shutdown():
19 | msg.header.stamp = rospy.Time.now()
20 | msg.transform.translation.x = math.cos(t)
21 | msg.transform.translation.y = math.sin(t)
22 | msg.transform.rotation.w = math.cos(t / 2)
23 | msg.transform.rotation.z = math.sin(t / 2)
24 | broadcaster.sendTransform(msg)
25 | t += 0.01
26 | rate.sleep()
27 |
--------------------------------------------------------------------------------
/src/test/display_test.test:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/test/embedded_materials_with_stl.yaml:
--------------------------------------------------------------------------------
1 | markers:
2 | - header: { seq: 0, stamp: { secs: 0, nsecs: 0 }, frame_id: base_link }
3 | ns: chunk
4 | id: 0
5 | type: 10
6 | action: 0
7 | pose:
8 | position: { x: 0, y: 0, z: 0 }
9 | orientation: { x: 0, y: 0, z: 0, w: 0 }
10 | color: { r: 1, g: 1, b: 0, a: 1 }
11 | scale: { x: .01, y: .01, z: .01 }
12 | frame_locked: False
13 | mesh_resource: "package://rviz/src/test/meshes/ax12_box.stl"
14 | mesh_use_embedded_materials: True
15 | - header: { seq: 0, stamp: { secs: 0, nsecs: 0 }, frame_id: base_link }
16 | ns: chunk
17 | id: 1
18 | type: 10
19 | action: 0
20 | pose:
21 | position: { x: 1, y: 0, z: 0 }
22 | orientation: { x: 0, y: 0, z: 0, w: 0 }
23 | color: { r: 1, g: 1, b: 0, a: 1 }
24 | scale: { x: .01, y: .01, z: .01 }
25 | frame_locked: False
26 | mesh_resource: "package://rviz/src/test/meshes/ax12_box.stl"
27 | mesh_use_embedded_materials: False
28 | - header: { seq: 0, stamp: { secs: 0, nsecs: 0 }, frame_id: base_link }
29 | ns: chunk
30 | id: 2
31 | type: 10
32 | action: 0
33 | pose:
34 | position: { x: 0, y: 1, z: 0 }
35 | orientation: { x: 0, y: 0, z: 0, w: 0 }
36 | color: { r: 1, g: 1, b: 0, a: 1 }
37 | scale: { x: 1, y: 1, z: 1 }
38 | frame_locked: False
39 | mesh_resource: "package://rviz/src/test/meshes/pr2-base.dae"
40 | mesh_use_embedded_materials: True
41 | - header: { seq: 0, stamp: { secs: 0, nsecs: 0 }, frame_id: base_link }
42 | ns: chunk
43 | id: 3
44 | type: 10
45 | action: 0
46 | pose:
47 | position: { x: 1, y: 1, z: 0 }
48 | orientation: { x: 0, y: 0, z: 0, w: 0 }
49 | color: { r: 1, g: 1, b: 0, a: 1 }
50 | scale: { x: 1, y: 1, z: 1 }
51 | frame_locked: False
52 | mesh_resource: "package://rviz/src/test/meshes/pr2-base.dae"
53 | mesh_use_embedded_materials: False
54 |
--------------------------------------------------------------------------------
/src/test/image_test.cpp:
--------------------------------------------------------------------------------
1 | #include "ros/ros.h"
2 |
3 | #include "sensor_msgs/Image.h"
4 |
5 | int main(int argc, char** argv)
6 | {
7 | ros::init(argc, argv, "image_test");
8 |
9 | ros::NodeHandle n;
10 |
11 | ros::Publisher rgb_pub = n.advertise("red_image", 0);
12 |
13 | ros::Duration(0.1).sleep();
14 |
15 | sensor_msgs::Image red_image;
16 | red_image.header.frame_id = "base_link";
17 | red_image.header.stamp = ros::Time::now();
18 | red_image.height = 100;
19 | red_image.width = 100;
20 | red_image.encoding = "rgb8";
21 | red_image.step = 3 * red_image.height;
22 |
23 | red_image.data.resize(3 * red_image.height * red_image.width);
24 | for (uint32_t i = 0; i < 3 * red_image.height * red_image.width; ++i)
25 | {
26 | if (i % 3 == 0)
27 | {
28 | red_image.data[i] = 255;
29 | }
30 | else
31 | {
32 | red_image.data[i] = 0;
33 | }
34 | }
35 |
36 | int i = 0;
37 | while (n.ok())
38 | {
39 | ROS_INFO("Publishing");
40 |
41 | rgb_pub.publish(red_image);
42 |
43 | ++i;
44 |
45 | ros::Duration(1.0).sleep();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/test/kitchen-mesh-marker.yaml:
--------------------------------------------------------------------------------
1 | header: { seq: 0, stamp: { secs: 0, nsecs: 0 }, frame_id: base_link }
2 | ns: chunk
3 | id: 0
4 | type: 10
5 | action: 0
6 | pose:
7 | position: { x: 0, y: 0, z: 0 }
8 | orientation: { x: 0, y: 0, z: 0, w: 1 }
9 | color: { r: 1, g: 1, b: 1, a: 1 }
10 | scale: { x: 1, y: 1, z: 1 }
11 | frame_locked: False
12 | mesh_resource: 'package://rviz/src/test/meshes/kitchen/models/dada.dae'
13 | mesh_use_embedded_materials: True
14 |
--------------------------------------------------------------------------------
/src/test/line_edit_with_button_test.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 |
32 | #include
33 |
34 | using namespace rviz;
35 |
36 | int main(int argc, char** argv)
37 | {
38 | QApplication app(argc, argv);
39 |
40 | LineEditWithButton lewb;
41 | lewb.resize(200, 50);
42 | lewb.show();
43 |
44 | return app.exec();
45 | }
46 |
--------------------------------------------------------------------------------
/src/test/map_test.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from nav_msgs.msg import OccupancyGrid
4 | import rospy
5 | import math
6 |
7 | topic = "moving_map"
8 | publisher = rospy.Publisher(topic, OccupancyGrid)
9 |
10 | rospy.init_node("map_test")
11 |
12 | grid = OccupancyGrid()
13 |
14 | t = 0
15 |
16 | while not rospy.is_shutdown():
17 | grid.header.frame_id = "map"
18 | grid.header.stamp = rospy.Time.now()
19 | grid.info.map_load_time = rospy.Time.now()
20 | grid.info.resolution = 1.0
21 | grid.info.width = 3
22 | grid.info.height = 3
23 | grid.info.origin.position.x = math.cos(t)
24 | grid.info.origin.position.y = math.sin(t)
25 | grid.info.origin.orientation.w = 1.0
26 | grid.data = [0, 20, 40, 60, 80, 100, 120, -10, -100]
27 |
28 | # Publish the MarkerArray
29 | publisher.publish(grid)
30 |
31 | rospy.sleep(0.05)
32 | t += 0.1
33 |
--------------------------------------------------------------------------------
/src/test/marker_array_test.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from visualization_msgs.msg import Marker
4 | from visualization_msgs.msg import MarkerArray
5 | import rospy
6 | import math
7 |
8 | topic = "visualization_marker_array"
9 | publisher = rospy.Publisher(topic, MarkerArray)
10 |
11 | rospy.init_node("register")
12 |
13 | markerArray = MarkerArray()
14 |
15 | count = 0
16 | MARKERS_MAX = 100
17 |
18 | while not rospy.is_shutdown():
19 |
20 | marker = Marker()
21 | marker.header.frame_id = "base_link"
22 | marker.type = marker.SPHERE
23 | marker.action = marker.ADD
24 | marker.scale.x = 0.2
25 | marker.scale.y = 0.2
26 | marker.scale.z = 0.2
27 | marker.color.a = 1.0
28 | marker.color.r = 1.0
29 | marker.color.g = 1.0
30 | marker.color.b = 0.0
31 | marker.pose.orientation.w = 1.0
32 | marker.pose.position.x = math.cos(count / 50.0)
33 | marker.pose.position.y = math.cos(count / 40.0)
34 | marker.pose.position.z = math.cos(count / 30.0)
35 |
36 | # We add the new marker to the MarkerArray, removing the oldest marker from it when necessary
37 | if count > MARKERS_MAX:
38 | markerArray.markers.pop(0)
39 |
40 | markerArray.markers.append(marker)
41 |
42 | # Renumber the marker IDs
43 | id = 0
44 | for m in markerArray.markers:
45 | m.id = id
46 | id += 1
47 |
48 | # Publish the MarkerArray
49 | publisher.publish(markerArray)
50 |
51 | count += 1
52 |
53 | rospy.sleep(0.01)
54 |
--------------------------------------------------------------------------------
/src/test/meshes/16bit_vs_32bit_should_fail.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/16bit_vs_32bit_should_fail.stl
--------------------------------------------------------------------------------
/src/test/meshes/F10.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/F10.stl
--------------------------------------------------------------------------------
/src/test/meshes/F2.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/F2.stl
--------------------------------------------------------------------------------
/src/test/meshes/F3.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/F3.stl
--------------------------------------------------------------------------------
/src/test/meshes/F4.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/F4.stl
--------------------------------------------------------------------------------
/src/test/meshes/README:
--------------------------------------------------------------------------------
1 | The meshes for these parts were created by I-Bioloid and obtain from:
2 | http://www.thingiverse.com/thing:5192
3 |
--------------------------------------------------------------------------------
/src/test/meshes/ax12_box.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/ax12_box.stl
--------------------------------------------------------------------------------
/src/test/meshes/base_color.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/base_color.tif
--------------------------------------------------------------------------------
/src/test/meshes/base_normals.tif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/base_normals.tif
--------------------------------------------------------------------------------
/src/test/meshes/finger.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/finger.stl
--------------------------------------------------------------------------------
/src/test/meshes/invalid.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/invalid.stl
--------------------------------------------------------------------------------
/src/test/meshes/invalid_end_tags.stl:
--------------------------------------------------------------------------------
1 | solid ascii.stl
2 |
3 | facet normal 0.648000e-001 0.648000e-002 0.648000e-003
4 | outer loop
5 | vertex 1.648000e-001 2.648000e-002 3.648000e-003
6 | vertex 4.648000e-001 5.648000e-002 6.648000e-003
7 | vertex 7.648000e-001 8.648000e-002 9.648000e-003
8 | end loop
9 | end facet
10 |
11 | facet normal 4.648000e-001 4.648000e-002 4.648000e-003
12 | outer loop
13 | vertex 10.648000e-001 11.648000e-002 12.648000e-003
14 | vertex 13.648000e-001 14.648000e-002 15.648000e-003
15 | vertex 16.648000e-001 17.648000e-002 18.648000e-003
16 | end loop
17 | end facet
18 |
19 | endsolid ascii.stl
20 |
--------------------------------------------------------------------------------
/src/test/meshes/invalid_extra.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/invalid_extra.stl
--------------------------------------------------------------------------------
/src/test/meshes/invalid_short.stl:
--------------------------------------------------------------------------------
1 | Binary STL file
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/doc.kml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | dada
5 | Google SketchUp 6.4.112]]>
6 | SketchUp
7 | 1
8 |
9 | 268.621
10 | 81.6735
11 | 40.01701040206847
12 | -105.2828779909634
13 | 6.259231800506925
14 | 0.9128535643034782
15 |
16 |
17 | Tour
18 |
19 | Camera
20 | 1
21 |
22 | 268.621
23 | 81.6735
24 | 40.01701040206847
25 | -105.2828779909634
26 | 6.259231800506925
27 | 0.9128535643034782
28 |
29 |
30 |
31 |
32 | Model
33 |
34 |
36 |
37 | relativeToGround
38 |
39 | -105.283000000000
40 | 40.017000000000
41 | 0.000000000000
42 |
43 |
44 | 0
45 | 0
46 | 0
47 |
48 |
49 | 1.0
50 | 1.0
51 | 1.0
52 |
53 |
54 | models/dada.dae
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture0.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture1.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture2.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture3.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture4.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture5.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/images/texture6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/kitchen/images/texture6.jpg
--------------------------------------------------------------------------------
/src/test/meshes/kitchen/textures.txt:
--------------------------------------------------------------------------------
1 | <../images/texture0.jpg> <../images/texture0.jpg>
2 | <../images/texture1.jpg> <../images/texture1.jpg>
3 | <../images/texture2.jpg> <../images/texture2.jpg>
4 | <../images/texture3.jpg> <../images/texture3.jpg>
5 | <../images/texture4.jpg> <../images/texture4.jpg>
6 | <../images/texture5.jpg> <../images/texture5.jpg>
7 | <../images/texture6.jpg> <../images/texture6.jpg>
8 |
--------------------------------------------------------------------------------
/src/test/meshes/valid.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-visualization/rviz/c4964de840d97b1377456a2054662551816b0a54/src/test/meshes/valid.stl
--------------------------------------------------------------------------------
/src/test/meshes/valid_ascii.stl:
--------------------------------------------------------------------------------
1 | solid valid_ascii.stl
2 | facet normal 1.240347e-01 -9.922779e-01 0.000000e+00
3 | outer loop
4 | vertex 1.648000e-01 2.648000e-02 3.648000e-03
5 | vertex 4.648000e-01 5.648000e-02 6.648000e-03
6 | vertex 7.648000e-01 8.648000e-02 9.648000e-03
7 | endloop
8 | endfacet
9 | facet normal 0.000000e+00 6.237829e-02 -9.980526e-01
10 | outer loop
11 | vertex 1.064800e+00 1.164800e-01 1.264800e-02
12 | vertex 1.364800e+00 1.464800e-01 1.564800e-02
13 | vertex 16.64800e-001 1.764800e-01 1.864800e-02
14 | endloop
15 | endfacet
16 | endsolid valid_ascii.stl
17 |
--------------------------------------------------------------------------------
/src/test/mock_context.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include "mock_display_factory.h"
31 |
32 | #include "mock_context.h"
33 |
34 | namespace rviz
35 | {
36 | MockContext::MockContext() : display_factory_(new MockDisplayFactory)
37 | {
38 | }
39 |
40 | } // end namespace rviz
41 |
--------------------------------------------------------------------------------
/src/test/mock_display.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef MOCK_DISPLAY_H
30 | #define MOCK_DISPLAY_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class VectorProperty;
37 | class ColorProperty;
38 |
39 | class MockDisplay : public Display
40 | {
41 | Q_OBJECT
42 | public:
43 | MockDisplay();
44 |
45 | Property* count_;
46 | Property* style_;
47 | Property* pi_;
48 | VectorProperty* offset_;
49 | ColorProperty* color_;
50 | };
51 |
52 | } // end namespace rviz
53 |
54 | #endif // MOCK_DISPLAY_H
55 |
--------------------------------------------------------------------------------
/src/test/mock_display_factory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef MOCK_DISPLAY_FACTORY_H
30 | #define MOCK_DISPLAY_FACTORY_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class MockDisplayFactory : public DisplayFactory
37 | {
38 | protected:
39 | virtual Display* makeRaw(const QString& class_id, QString* error_return = NULL);
40 | };
41 |
42 | } // end namespace rviz
43 |
44 | #endif // MOCK_DISPLAY_FACTORY_H
45 |
--------------------------------------------------------------------------------
/src/test/mock_property_change_receiver.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 |
32 | #include "mock_property_change_receiver.h"
33 |
34 | namespace rviz
35 | {
36 | void MockPropertyChangeReceiver::aboutToChange()
37 | {
38 | if (Property* p = qobject_cast(sender()))
39 | result += " aboutToChange, v=" + p->getValue().toString();
40 | }
41 |
42 | void MockPropertyChangeReceiver::changed()
43 | {
44 | if (Property* p = qobject_cast(sender()))
45 | result += " changed, v=" + p->getValue().toString();
46 | }
47 |
48 | } // end namespace rviz
49 |
--------------------------------------------------------------------------------
/src/test/mock_property_change_receiver.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 | #ifndef MOCK_PROPERTY_CHANGE_RECEIVER_H
30 | #define MOCK_PROPERTY_CHANGE_RECEIVER_H
31 |
32 | #include
33 |
34 | namespace rviz
35 | {
36 | class MockPropertyChangeReceiver : public QObject
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | QString result;
42 |
43 | void reset()
44 | {
45 | result = "";
46 | }
47 |
48 | public Q_SLOTS:
49 | void aboutToChange();
50 | void changed();
51 | };
52 |
53 | } // end namespace rviz
54 |
55 | #endif // MOCK_PROPERTY_CHANGE_RECEIVER_H
56 |
--------------------------------------------------------------------------------
/src/test/posearray.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from geometry_msgs.msg import Pose
4 | from geometry_msgs.msg import PoseArray
5 | import rospy
6 |
7 | topic = "test_poses"
8 | publisher = rospy.Publisher(topic, PoseArray)
9 |
10 | rospy.init_node("posearray")
11 |
12 | while not rospy.is_shutdown():
13 |
14 | ps = PoseArray()
15 | ps.header.frame_id = "base_link"
16 | ps.header.stamp = rospy.Time.now()
17 |
18 | pose = Pose()
19 | pose.position.x = 2
20 | pose.position.y = 2
21 | pose.position.z = 0
22 | pose.orientation.x = 0
23 | pose.orientation.y = 0
24 | pose.orientation.z = 0.7071
25 | pose.orientation.w = 0.7071
26 |
27 | ps.poses.append(pose)
28 |
29 | pose = Pose()
30 | pose.position.x = 1
31 | pose.position.y = 1
32 | pose.position.z = 0
33 | pose.orientation.x = 0
34 | pose.orientation.y = 0
35 | pose.orientation.z = 0
36 | pose.orientation.w = 1
37 |
38 | ps.poses.append(pose)
39 |
40 | publisher.publish(ps)
41 |
42 | rospy.sleep(0.1)
43 |
--------------------------------------------------------------------------------
/src/test/publish_test_map.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import rospy
4 | import numpy
5 |
6 | from nav_msgs.msg import OccupancyGrid
7 |
8 | pub = rospy.Publisher("test_map", OccupancyGrid, latch=True)
9 | rospy.init_node("test_map")
10 |
11 | _map = OccupancyGrid()
12 | _map.header.stamp = rospy.get_rostime()
13 | _map.header.frame_id = "map"
14 | _map.info.resolution = 0.1
15 | _map.info.width = 16
16 | _map.info.height = 16
17 | _map.info.origin.orientation.w = 1
18 | _map.data = [numpy.int8(x) for x in range(256)]
19 |
20 | pub.publish(_map)
21 |
22 | rospy.spin()
23 |
--------------------------------------------------------------------------------
/src/test/ros_spinner.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 |
32 | #include "ros_spinner.h"
33 |
34 | RosSpinner::RosSpinner()
35 | {
36 | QTimer* timer = new QTimer(this);
37 | connect(timer, SIGNAL(timeout()), this, SLOT(onTimer()));
38 | timer->start(10);
39 | }
40 |
41 | void RosSpinner::onTimer()
42 | {
43 | if (ros::ok())
44 | {
45 | ros::spinOnce();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/test/ros_spinner.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, Willow Garage, Inc.
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Willow Garage, Inc. nor the names of its
14 | * contributors may be used to endorse or promote products derived from
15 | * this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 | * POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #ifndef RVIZ_TEST_ROS_SPINNER_H
31 | #define RVIZ_TEST_ROS_SPINNER_H
32 |
33 | #include
34 |
35 | #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
36 | #include
37 | #endif
38 |
39 | class RosSpinner : public QObject
40 | {
41 | Q_OBJECT
42 | public:
43 | RosSpinner();
44 |
45 | private Q_SLOTS:
46 | void onTimer();
47 | };
48 |
49 | #endif // RVIZ_TEST_ROS_SPINNER_H
50 |
--------------------------------------------------------------------------------
/src/test/sample_file.yaml:
--------------------------------------------------------------------------------
1 | Enabled: true
2 | Displays:
3 | -
4 | Class: MockDisplay
5 | Name: Steven
6 | Enabled: false
7 | Count: 17
8 | Style: a b c d e !@#$%^:&
9 | Offset:
10 | X: 1
11 | Y: 2
12 | Z: 1000.1
13 | Color: orange
14 | -
15 | Name: sub group
16 | Class: DisplayGroup
17 | Enabled: true
18 | Displays:
19 | -
20 | Name: sub group
21 | Class: DisplayGroup
22 | Enabled: true
23 | Displays:
24 | -
25 | Name: sub group
26 | Class: DisplayGroup
27 | Enabled: true
28 | Displays:
29 | -
30 | Name: sub group
31 | Class: DisplayGroup
32 | Enabled: true
33 | Displays:
34 | -
35 | Class: MockDisplay
36 | Name: Curly
37 | Enabled: false
38 | Count: 9000
39 | -
40 | Class: BrokenDisplay
41 | Name: Joe
42 | Enabled: true
43 | Count: 33
44 | -
45 | Class: BrokenDisplay
46 | Name: Joe
47 | Enabled: true
48 | Count: 33
49 | -
50 | Class: BrokenDisplay
51 | Name: Joe
52 | Enabled: true
53 | Count: 33
54 |
--------------------------------------------------------------------------------
/src/test/send_bad_pc2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # This program publishes a pointcloud2 which has much shorter data
4 | # than what is described by width, height, and point_step. RViz
5 | # should catch this and show an error instead of crashing.
6 |
7 | import rospy
8 | from sensor_msgs.msg import PointCloud2
9 | from sensor_msgs.msg import PointField
10 |
11 | rospy.init_node("bad_pointcloud_publisher")
12 |
13 | pfx = PointField()
14 | pfx.name = "x"
15 | pfx.offset = 0
16 | pfx.datatype = 7
17 | pfx.count = 1
18 |
19 | pfy = PointField()
20 | pfy.name = "y"
21 | pfy.offset = 4
22 | pfy.datatype = 7
23 | pfy.count = 1
24 |
25 | pfz = PointField()
26 | pfz.name = "z"
27 | pfz.offset = 8
28 | pfz.datatype = 7
29 | pfz.count = 1
30 |
31 | pc = PointCloud2()
32 |
33 | pc.header.frame_id = "map"
34 | pc.header.stamp = rospy.Time.now()
35 |
36 | pc.fields = [pfx, pfy, pfz]
37 | pc.data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
38 | pc.width = 10
39 | pc.height = 10
40 | pc.point_step = 12
41 | pc.row_step = 120
42 | pc.is_dense = False
43 |
44 | pub = rospy.Publisher("bad_pointcloud", PointCloud2)
45 |
46 | while not rospy.is_shutdown():
47 | print("publishing bad PointCloud2.")
48 | pub.publish(pc)
49 | rospy.sleep(1.0)
50 |
--------------------------------------------------------------------------------
/src/test/send_efforts.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from sensor_msgs.msg import JointState
4 | from math import pi, sin
5 | import rospy
6 |
7 | topic = "joint_states"
8 | publisher = rospy.Publisher(topic, JointState, queue_size=1)
9 | rospy.init_node("send_efforts")
10 |
11 | t = 0
12 | msg = JointState()
13 | msg.name = [
14 | "panda_joint1",
15 | "panda_joint2",
16 | "panda_joint3",
17 | "panda_joint4",
18 | "panda_joint5",
19 | "panda_joint6",
20 | "panda_joint7",
21 | "panda_finger_joint1",
22 | ]
23 | N = len(msg.name)
24 | msg.position = [0.0 for i in range(N)]
25 |
26 | while not rospy.is_shutdown():
27 | msg.header.stamp = rospy.Time.now()
28 | msg.effort = [10.0 * sin(t) for i in range(N)]
29 | publisher.publish(msg)
30 | t = t + 0.1
31 | rospy.sleep(0.1)
32 |
--------------------------------------------------------------------------------
/src/test/send_odometry.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from nav_msgs.msg import Odometry
4 | import rospy
5 |
6 | topic = "test_odometry"
7 | publisher = rospy.Publisher(topic, Odometry)
8 |
9 | rospy.init_node("send_odometry")
10 |
11 | y = 0
12 | while not rospy.is_shutdown():
13 |
14 | odo = Odometry()
15 | odo.header.frame_id = "base_link"
16 | odo.header.stamp = rospy.Time.now()
17 |
18 | odo.pose.pose.position.x = 0
19 | odo.pose.pose.position.y = y
20 | odo.pose.pose.position.z = 0
21 |
22 | odo.pose.pose.orientation.x = 0
23 | odo.pose.pose.orientation.y = 0
24 | odo.pose.pose.orientation.z = 0
25 | odo.pose.pose.orientation.w = 1
26 |
27 | publisher.publish(odo)
28 |
29 | y = y + 0.2
30 | if y > 5:
31 | y = -5
32 |
33 | rospy.sleep(0.1)
34 |
--------------------------------------------------------------------------------
/src/test/send_path.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from nav_msgs.msg import Path
4 | from geometry_msgs.msg import PoseStamped
5 | import math
6 | import rospy
7 | import tf.transformations as tf
8 |
9 | topic = "test_path"
10 | publisher = rospy.Publisher(topic, Path, queue_size=1)
11 |
12 | rospy.init_node("send_path")
13 |
14 | t = 0
15 | rate = rospy.Rate(30)
16 | timestep = rate.sleep_dur.to_sec()
17 | while not rospy.is_shutdown():
18 |
19 | p = Path()
20 | p.header.frame_id = "base_link"
21 | p.header.stamp = rospy.Time.now()
22 |
23 | num_points = 50
24 | for i in range(0, num_points):
25 | ps = PoseStamped()
26 | ps.header.stamp = p.header.stamp
27 | ps.header.frame_id = p.header.frame_id
28 | ps.pose.position.x = 10.0 * i / (num_points - 1) - 5
29 | ps.pose.position.y = math.sin(10.0 * i / num_points + t)
30 | ps.pose.position.z = 0
31 | angle = 2 * math.pi * i / num_points + t
32 | quat = tf.quaternion_from_euler(angle, 0, 0)
33 | ps.pose.orientation.x = quat[0]
34 | ps.pose.orientation.y = quat[1]
35 | ps.pose.orientation.z = quat[2]
36 | ps.pose.orientation.w = quat[3]
37 | p.poses.append(ps)
38 |
39 | publisher.publish(p)
40 |
41 | t += timestep
42 | rate.sleep()
43 |
--------------------------------------------------------------------------------
/src/test/send_point.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from geometry_msgs.msg import PointStamped
4 | import math
5 | import rospy
6 |
7 | topic = "test_point"
8 | publisher = rospy.Publisher(topic, PointStamped)
9 |
10 | rospy.init_node("send_point")
11 |
12 | t = 0
13 | while not rospy.is_shutdown():
14 |
15 | p = PointStamped()
16 | p.header.frame_id = "base_link"
17 | p.header.stamp = rospy.Time.now()
18 |
19 | r = 5.0
20 | p.point.x = r * math.cos(t)
21 | p.point.y = r * math.sin(t)
22 | p.point.z = 0
23 |
24 | publisher.publish(p)
25 |
26 | t += 0.1
27 |
28 | rospy.sleep(0.03)
29 |
--------------------------------------------------------------------------------
/src/test/send_point_cloud_2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # This program publishes a pointcloud2 to test rviz rendering
4 |
5 | from __future__ import print_function
6 |
7 | import rospy
8 | import numpy as np
9 | from sensor_msgs import point_cloud2
10 | from sensor_msgs.msg import PointCloud2
11 | from sensor_msgs.msg import PointField
12 | from std_msgs.msg import Header
13 |
14 | width = 100
15 | height = 100
16 |
17 |
18 | def publishPC2(count):
19 | fields = [
20 | PointField("x", 0, PointField.FLOAT32, 1),
21 | PointField("y", 4, PointField.FLOAT32, 1),
22 | PointField("z", 8, PointField.FLOAT32, 1),
23 | PointField("intensity", 12, PointField.FLOAT32, 1),
24 | ]
25 |
26 | header = Header()
27 | header.frame_id = "map"
28 | header.stamp = rospy.Time.now()
29 |
30 | x, y = np.meshgrid(np.linspace(-2, 2, width), np.linspace(-2, 2, height))
31 | z = 0.5 * np.sin(2 * x - count / 10.0) * np.sin(2 * y)
32 | points = np.array([x, y, z, z]).reshape(4, -1).T
33 |
34 | pc2 = point_cloud2.create_cloud(header, fields, points)
35 | pub.publish(pc2)
36 |
37 |
38 | if __name__ == "__main__":
39 | rospy.init_node("pc2_publisher")
40 | pub = rospy.Publisher("points2", PointCloud2, queue_size=100)
41 | rate = rospy.Rate(10)
42 |
43 | count = 0
44 | while not rospy.is_shutdown():
45 | publishPC2(count)
46 | count += 1
47 | rate.sleep()
48 |
--------------------------------------------------------------------------------
/src/test/send_polygon.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from geometry_msgs.msg import PolygonStamped
4 | from geometry_msgs.msg import Point32
5 | import math
6 | import rospy
7 |
8 | topic = "test_polygon"
9 | publisher = rospy.Publisher(topic, PolygonStamped)
10 |
11 | rospy.init_node("send_polygon")
12 |
13 | t = 0
14 | while not rospy.is_shutdown():
15 |
16 | p = PolygonStamped()
17 | p.header.frame_id = "base_link"
18 | p.header.stamp = rospy.Time.now()
19 |
20 | dr = 0.5 * math.cos(t)
21 | radii = [1 - dr, 1 + dr]
22 | radius_index = 0
23 | num_points = 10
24 | for i in range(0, num_points):
25 | point = Point32()
26 | radius = radii[radius_index]
27 | radius_index = (radius_index + 1) % 2
28 | point.x = radius * math.cos(i * 2 * math.pi / num_points)
29 | point.y = radius * math.sin(i * 2 * math.pi / num_points)
30 | point.z = 0
31 | p.polygon.points.append(point)
32 |
33 | publisher.publish(p)
34 |
35 | t += 0.1
36 |
37 | rospy.sleep(0.03)
38 |
--------------------------------------------------------------------------------
/src/test/send_pose.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from geometry_msgs.msg import PoseStamped
4 | import math
5 | import rospy
6 |
7 | topic = "test_pose"
8 | publisher = rospy.Publisher(topic, PoseStamped)
9 |
10 | rospy.init_node("send_pose")
11 |
12 | t = 0
13 | while not rospy.is_shutdown():
14 |
15 | p = PoseStamped()
16 | p.header.frame_id = "base_link"
17 | p.header.stamp = rospy.Time.now()
18 |
19 | r = 5.0
20 | p.pose.position.x = r * math.cos(t)
21 | p.pose.position.y = r * math.sin(t)
22 | p.pose.position.z = 0
23 | p.pose.orientation.x = 0
24 | p.pose.orientation.y = 0
25 | p.pose.orientation.z = math.sin(0.5 * t)
26 | p.pose.orientation.w = math.cos(0.5 * t)
27 |
28 | publisher.publish(p)
29 |
30 | t += 0.1
31 |
32 | rospy.sleep(0.03)
33 |
--------------------------------------------------------------------------------
/src/test/send_range.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from sensor_msgs.msg import Range
4 | import rospy
5 |
6 | topic = "test_range"
7 | publisher = rospy.Publisher(topic, Range)
8 |
9 | rospy.init_node("range_test")
10 |
11 | dist = 3
12 |
13 | while not rospy.is_shutdown():
14 |
15 | r = Range()
16 | r.header.frame_id = "base_link"
17 | r.header.stamp = rospy.Time.now()
18 |
19 | r.radiation_type = 0
20 | r.field_of_view = 2.0 / dist
21 | r.min_range = 0.4
22 | r.max_range = 10
23 | r.range = dist
24 |
25 | publisher.publish(r)
26 |
27 | rospy.sleep(0.1)
28 |
29 | dist += 0.3
30 | if dist > 10:
31 | dist = 3
32 |
--------------------------------------------------------------------------------
/src/test/send_wrench.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from geometry_msgs.msg import WrenchStamped
4 | import math
5 | import rospy
6 |
7 | topic = "test_wrench"
8 | publisher = rospy.Publisher(topic, WrenchStamped)
9 |
10 | rospy.init_node("send_wrench")
11 |
12 | t = 0
13 | while not rospy.is_shutdown():
14 |
15 | p = WrenchStamped()
16 | p.header.frame_id = "base_link"
17 | p.header.stamp = rospy.Time.now()
18 |
19 | f = 0.5 * math.sin(t)
20 | p.wrench.force.x = 0
21 | p.wrench.force.y = 0
22 | p.wrench.force.z = f * math.sin(t)
23 |
24 | q = 0.5 + 0.5 * math.sin(t / 3.14)
25 | p.wrench.torque.x = q * math.sin(t)
26 | p.wrench.torque.y = q * math.cos(t)
27 | p.wrench.torque.z = 0
28 |
29 | publisher.publish(p)
30 |
31 | t += 0.1
32 |
33 | rospy.sleep(0.03)
34 |
--------------------------------------------------------------------------------
/src/test/stl_loader_test.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | TEST(STLLoader, load)
7 | {
8 | // Get the path to the directory where the meshes are located.
9 | std::string meshDir = "package://rviz/src/test/meshes/";
10 |
11 | // Load a valid ascii STL file.
12 | std::string meshFilePath = meshDir + "valid_ascii.stl";
13 | EXPECT_TRUE(rviz::loadMeshFromResource(meshFilePath).get());
14 |
15 | // Load an invalid ascii STL file, using "end facet" instead of "endfacet"
16 | meshFilePath = meshDir + "invalid_end_tags.stl";
17 | EXPECT_FALSE(rviz::loadMeshFromResource(meshFilePath).get());
18 |
19 | // Load an invalid STL binary file (size < 84 bytes).
20 | meshFilePath = meshDir + "invalid_short.stl";
21 | EXPECT_FALSE(rviz::loadMeshFromResource(meshFilePath).get());
22 |
23 | // Load an invalid STL binary file (size does not match the expected size).
24 | meshFilePath = meshDir + "invalid.stl";
25 | EXPECT_FALSE(rviz::loadMeshFromResource(meshFilePath).get());
26 |
27 | // Load an invalid STL binary file (size does not match the expected size,
28 | // but does if incorrectly read as an 16-bit uint)
29 | meshFilePath = meshDir + "16bit_vs_32bit_should_fail.stl";
30 | EXPECT_FALSE(rviz::loadMeshFromResource(meshFilePath).get());
31 |
32 | // Load a valid STL binary file.
33 | meshFilePath = meshDir + "valid.stl";
34 | EXPECT_TRUE(rviz::loadMeshFromResource(meshFilePath).get());
35 |
36 | // Load a "potentially" valid STL binary file with extra data at the end of the file
37 | meshFilePath = meshDir + "invalid_extra.stl";
38 | EXPECT_FALSE(rviz::loadMeshFromResource(meshFilePath).get());
39 | }
40 |
41 | int main(int argc, char** argv)
42 | {
43 | testing::InitGoogleTest(&argc, argv);
44 |
45 | // initialize ogre resource system
46 | rviz::RenderSystem::get();
47 |
48 | return RUN_ALL_TESTS();
49 | }
50 |
--------------------------------------------------------------------------------
/src/test/triangle_list_marker.yaml:
--------------------------------------------------------------------------------
1 | header:
2 | seq: 1
3 | stamp:
4 | secs: 0
5 | nsecs: 0
6 | frame_id: base_link
7 | ns: cube
8 | id: 1
9 | type: 11
10 | action: 0
11 | pose:
12 | position:
13 | x: 0.0
14 | y: 0.0
15 | z: 0.0
16 | orientation:
17 | x: 0.0
18 | y: 0.0
19 | z: 0.0
20 | w: 1.0
21 | scale:
22 | x: 1.0
23 | y: 1.0
24 | z: 1.0
25 | color:
26 | r: .5
27 | g: .5
28 | b: 1
29 | a: 1
30 | lifetime:
31 | secs: 0
32 | nsecs: 0
33 | frame_locked: False
34 | text: ""
35 | points:
36 | - x: 0
37 | y: 0
38 | z: 0
39 | - x: 1
40 | y: 0
41 | z: 0
42 | - x: 1
43 | y: 1
44 | z: 0
45 | - x: 0
46 | y: 0
47 | z: 0
48 | - x: 1
49 | y: 0
50 | z: 0
51 | - x: 1
52 | y: 0
53 | z: 1
54 | - x: 0
55 | y: 0
56 | z: 0
57 | - x: 0
58 | y: 0
59 | z: 0
60 | - x: 0
61 | y: 0
62 | z: 0
63 | mesh_resource: ""
64 | mesh_use_embedded_materials: False
65 |
--------------------------------------------------------------------------------
/srv/SendFilePath.srv:
--------------------------------------------------------------------------------
1 | std_msgs/String path # absolute path to file or directory
2 | ---
3 | bool success
4 |
--------------------------------------------------------------------------------