Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extension test #668

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,36 @@ notifications:
on_failure: always
jobs:
include:
- stage: build-shadow-fixed
- stage: build
env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
arch: amd64
- env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
arch: arm64
- env: ROS_DISTRO="melodic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- stage: build-released
env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: amd64
- env: ROS_DISTRO="melodic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
arch: arm64
- env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: amd64
- env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: arm64
- env: ROS_DISTRO="melodic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: amd64
- env: ROS_DISTRO="melodic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- stage: lint
arch: arm64
- env: JOB="catkin_lint"
sudo: false
install: pip install --user -q catkin-lint
script: catkin_lint -W2 --explain .
env: JOB="catkin_lint"
allow_failures:
- env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: amd64
- env: ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: arm64
- env: ROS_DISTRO="melodic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: amd64
- env: ROS_DISTRO="melodic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
arch: arm64
- env: JOB="catkin_lint"
matrix:
allow_failures:
Expand All @@ -31,4 +47,4 @@ install:
- git clone https://github.com/ros-industrial/industrial_ci.git .ci_config
script:
- source .ci_config/travis.sh
# - source ./travis.sh # Enable this when you have a package-local script

7 changes: 6 additions & 1 deletion mapviz/include/mapviz/map_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

// QT libraries
#include <QGLWidget>
#include <QGLFunctions>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QColor>
Expand All @@ -52,9 +53,13 @@

#include <mapviz/mapviz_plugin.h>

#ifdef __aarch64__
#include <GL/gl.h>
#endif

namespace mapviz
{
class MapCanvas : public QGLWidget
class MapCanvas : public QGLWidget, protected QGLFunctions
{
Q_OBJECT

Expand Down
4 changes: 4 additions & 0 deletions mapviz/include/mapviz/mapviz_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

#include "stopwatch.h"

#ifdef __aarch64__
#include <GL/gl.h>
#endif

namespace mapviz
{
class MapvizPlugin : public QObject
Expand Down
47 changes: 27 additions & 20 deletions mapviz/src/map_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
// *****************************************************************************


#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
//#include <GL/glew.h>
matt-attack marked this conversation as resolved.
Show resolved Hide resolved
//#include <GL/gl.h>
//#include <GL/glu.h>

#include <mapviz/map_canvas.h>

Expand Down Expand Up @@ -96,7 +96,7 @@ MapCanvas::~MapCanvas()
{
if(pixel_buffer_size_ != 0)
{
glDeleteBuffersARB(2, pixel_buffer_ids_);
glDeleteBuffers(2, pixel_buffer_ids_);
}
}

Expand All @@ -105,6 +105,10 @@ void MapCanvas::InitializeTf(boost::shared_ptr<tf::TransformListener> tf)
tf_ = tf;
}

void* (*glMapBuffer)(GLenum target, GLenum buffer);

void (*glUnmapBuffer)(GLenum target);

void MapCanvas::InitializePixelBuffers()
{
if(has_pixel_buffers_)
Expand All @@ -115,15 +119,15 @@ void MapCanvas::InitializePixelBuffers()
{
if (pixel_buffer_size_ != 0)
{
glDeleteBuffersARB(2, pixel_buffer_ids_);
glDeleteBuffers(2, pixel_buffer_ids_);
}

glGenBuffersARB(2, pixel_buffer_ids_);
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pixel_buffer_ids_[0]);
glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, buffer_size, 0, GL_STREAM_READ_ARB);
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pixel_buffer_ids_[1]);
glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, buffer_size, 0, GL_STREAM_READ_ARB);
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
glGenBuffers(2, pixel_buffer_ids_);
glBindBuffer(GL_PIXEL_PACK_BUFFER, pixel_buffer_ids_[0]);
glBufferData(GL_PIXEL_PACK_BUFFER, buffer_size, 0, GL_STREAM_READ);
glBindBuffer(GL_PIXEL_PACK_BUFFER, pixel_buffer_ids_[1]);
glBufferData(GL_PIXEL_PACK_BUFFER, buffer_size, 0, GL_STREAM_READ);
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);

pixel_buffer_size_ = buffer_size;
}
Expand All @@ -132,16 +136,19 @@ void MapCanvas::InitializePixelBuffers()

void MapCanvas::initializeGL()
{
GLenum err = glewInit();
if (GLEW_OK != err)
//GLenum err = glewInit();
if (false)//GLEW_OK != err)
{
ROS_ERROR("Error: %s\n", glewGetErrorString(err));
//ROS_ERROR("Error: %s\n", glewGetErrorString(err));
}
else
{
// Check if pixel buffers are available for asynchronous capturing
std::string extensions = (const char*)glGetString(GL_EXTENSIONS);
has_pixel_buffers_ = extensions.find("GL_ARB_pixel_buffer_object") != std::string::npos;
has_pixel_buffers_ = false;//extensions.find("GL_ARB_pixel_buffer_object") != std::string::npos;

// now load the extension...
//glMapBuffer = glXGetProcAddress("glMapBuffer");
}

glClearColor(0.58f, 0.56f, 0.5f, 1);
Expand Down Expand Up @@ -192,19 +199,19 @@ void MapCanvas::CaptureFrame(bool force)
pixel_buffer_index_ = (pixel_buffer_index_ + 1) % 2;
int32_t next_index = (pixel_buffer_index_ + 1) % 2;

glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pixel_buffer_ids_[pixel_buffer_index_]);
glBindBuffer(GL_PIXEL_PACK_BUFFER, pixel_buffer_ids_[pixel_buffer_index_]);
glReadPixels(0, 0, width(), height(), GL_BGRA, GL_UNSIGNED_BYTE, 0);
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pixel_buffer_ids_[next_index]);
GLubyte* data = reinterpret_cast<GLubyte*>(glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB));
glBindBuffer(GL_PIXEL_PACK_BUFFER, pixel_buffer_ids_[next_index]);
GLubyte* data = reinterpret_cast<GLubyte*>(glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY));
if(data)
{
capture_buffer_.resize(pixel_buffer_size_);

memcpy(&capture_buffer_[0], data, pixel_buffer_size_);

glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
}
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion mapviz_plugins/include/mapviz_plugins/pointcloud2_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <mapviz/mapviz_plugin.h>

// QT libraries
#include <QGLFunctions>
#include <QGLWidget>
#include <QColor>
#include <QMutex>
Expand All @@ -51,7 +52,7 @@

namespace mapviz_plugins
{
class PointCloud2Plugin : public mapviz::MapvizPlugin
class PointCloud2Plugin : public mapviz::MapvizPlugin, protected QGLFunctions
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/occupancy_grid_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//
// *****************************************************************************

#include <GL/glew.h>
//#include <GL/glew.h>

#include <mapviz_plugins/occupancy_grid_plugin.h>
#include <GL/glut.h>
Expand Down
2 changes: 1 addition & 1 deletion mapviz_plugins/src/pointcloud2_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//
// *****************************************************************************

#include <GL/glew.h>
//#include <GL/glew.h>
#include <mapviz_plugins/pointcloud2_plugin.h>

// C++ standard libraries
Expand Down
1 change: 1 addition & 0 deletions multires_image/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${Qt_LIBRARIES}
${OPENGL_gl_LIBRARY}
${GLU_LIBRARY}
)

Expand Down
2 changes: 2 additions & 0 deletions multires_image/src/QGLMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <multires_image/QGLMap.h>

#include <GL/gl.h>

// C++ standard libraries
#include <cmath>

Expand Down
2 changes: 2 additions & 0 deletions multires_image/src/multires_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <cmath>
#include <iostream>

#include <GL/gl.h>

#include <ros/ros.h>
#include <swri_transform_util/transform_util.h>

Expand Down
1 change: 1 addition & 0 deletions multires_image/src/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <iostream>

// QT libraries
#include <GL/gl.h>
#include <QGLWidget>
#include <QFile>

Expand Down
2 changes: 2 additions & 0 deletions multires_image/src/tile_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <multires_image/tile_view.h>

#include <GL/gl.h>

// C++ standard libraries
#include <cmath>
#include <iostream>
Expand Down
4 changes: 3 additions & 1 deletion tile_map/include/tile_map/tile_map_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

#include <swri_transform_util/transform.h>

#include <QGLFunctions>

namespace tile_map
{
class TileSource;
Expand All @@ -58,7 +60,7 @@ namespace tile_map
std::vector<tf::Vector3> points_t;
};

class TileMapView
class TileMapView: protected QGLFunctions
{
public:
TileMapView();
Expand Down
11 changes: 6 additions & 5 deletions tile_map/src/texture_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@

#include <boost/make_shared.hpp>

#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
//#include <GL/glew.h>
//#include <GL/gl.h>
//#include <GL/glu.h>

#include <ros/ros.h>

#include <QGLFunctions>
#include <QGLWidget>
#include <QImage>

Expand Down Expand Up @@ -109,8 +110,8 @@ namespace tile_map
ROS_ERROR("FAILED TO CREATE TEXTURE");

GLenum err = glGetError();
const GLubyte *errString = gluErrorString(err);
ROS_ERROR("GL ERROR(%u): %s", err, errString);
//const GLubyte *errString = gluErrorString(err);
ROS_ERROR("GL ERROR(%u): %s", err, "unknown");
return texture;
}

Expand Down
2 changes: 0 additions & 2 deletions tile_map/src/tile_map_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@

#include <boost/make_shared.hpp>

#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>

#include <ros/ros.h>

Expand Down