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

Update bot_core_sensor_status_t.lcm #19

Open
wants to merge 8 commits into
base: drake
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
177 changes: 102 additions & 75 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ string(TIMESTAMP timestamp "%Y%m%d" UTC)

project(libbot2 VERSION 0.0.1.${timestamp})

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/install" CACHE STRING
"Install path prefix, prepended onto install directories" FORCE)
endif()

option(PACKAGE_LIBBOT2 "Set install prefix to package libbot2 on linux" OFF)
if(PACKAGE_LIBBOT2)
set(CMAKE_INSTALL_PREFIX "/opt/${CMAKE_PROJECT_NAME}/${PROJECT_VERSION}" CACHE PATH "Install location for project" FORCE)
Expand Down Expand Up @@ -46,16 +51,18 @@ find_package(PythonInterp REQUIRED)
# Look for the gdkx.h header to decide whether the local gtk2 install has
# X11 support or not.
find_file(GDKX_HEADER gdkx.h PATH_SUFFIXES gtk-2.0/gdk)

if(GDKX_HEADER)
set(bot_vis_default ON)
message(STATUS "gdkx.h found, system appears to have gtk+X11 support")
message(STATUS "gdkx.h found, system appears to have GTK+ X11 support")
else()
set(bot_vis_default OFF)
message(STATUS "gdkx.h not found, system not appear to have gtk+X11 support")
message(STATUS "gdkx.h not found, system does not appear to have GTK+ X11 support")
endif()

mark_as_advanced(GDKX_HEADER)

option(WITH_BOT_VIS "Build with bot2-vis" ${bot_vis_default})
include(CMakeDependentOption)

cmake_dependent_option(WITH_BOT_VIS "Build with bot2-vis" ON GDKX_HEADER OFF)

include(ExternalProject)

Expand Down Expand Up @@ -100,94 +107,114 @@ ExternalProject_Add(bot2-core
BUILD_ALWAYS 1)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-core;bot2core;Unspecified;/")

ExternalProject_Add(bot2-procman
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-procman
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-procman
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
"-DLCM_PYTHON_DIR_HINTS:PATH=${LCM_PYTHON_DIR_HINTS}"
${INSTALL_CMD}
BUILD_ALWAYS 1)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-procman;bot2-procman;ALL;/")

ExternalProject_Add(bot2-lcm-utils
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-lcm-utils
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-lcm-utils
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
"-DLCM_PYTHON_DIR_HINTS:PATH=${LCM_PYTHON_DIR_HINTS}"
${INSTALL_CMD}
BUILD_ALWAYS 1)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-lcm-utils;bot2-lcm-utils;ALL;/")

ExternalProject_Add(bot2-param
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-param
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-param
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
${INSTALL_CMD}
DEPENDS bot2-core)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-param;bot2-param;ALL;/")

if(WITH_BOT_VIS)

message(STATUS "Configuring with bot2-vis, modules requiring gtk+x11 will be built.")
option(WITH_BOT_PROCMAN "Build with bot2-procman" ON)

ExternalProject_Add(bot2-vis
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-vis
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-vis
CMAKE_ARGS ${default_cmake_args}
if(WITH_BOT_PROCMAN)
ExternalProject_Add(bot2-procman
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-procman
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-procman
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
"-DLCM_PYTHON_DIR_HINTS:PATH=${LCM_PYTHON_DIR_HINTS}"
${INSTALL_CMD}
DEPENDS bot2-core)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-vis;bot2-vis;ALL;/")
BUILD_ALWAYS 1)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-procman;bot2-procman;ALL;/")
endif()

ExternalProject_Add(bot2-lcmgl
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-lcmgl
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-lcmgl
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args} -DUSE_BOT_VIS:BOOL=${WITH_BOT_VIS}
${INSTALL_CMD}
DEPENDS bot2-core bot2-vis)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-lcmgl;bot2-lcmgl;ALL;/")
option(WITH_BOT_LCM_UTILS "Build with lcm-utils" ON)

ExternalProject_Add(bot2-frames
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-frames
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-frames
if(WITH_BOT_LCM_UTILS)
ExternalProject_Add(bot2-lcm-utils
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-lcm-utils
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-lcm-utils
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
"-DLCM_PYTHON_DIR_HINTS:PATH=${LCM_PYTHON_DIR_HINTS}"
${INSTALL_CMD}
DEPENDS bot2-core bot2-param bot2-vis bot2-lcmgl)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-frames;bot2-frames;ALL;/")
BUILD_ALWAYS 1)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-lcm-utils;bot2-lcm-utils;ALL;/")
endif()

else()
option(WITH_BOT_PARAM "Build with bot2-param" ON)

message(STATUS "Configuring without bot2-vis, modules requiring gtk+x11 will not be built.")
find_package(X11 REQUIRED )
find_package(ZLIB REQUIRED)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(GTK2 REQUIRED)
find_package(GLUT REQUIRED)

ExternalProject_Add(bot2-lcmgl
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-lcmgl
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-lcmgl
CMAKE_ARGS ${default_cmake_args} -DUSE_BOT_VIS:BOOL=${WITH_BOT_VIS}
if(WITH_BOT_PARAM)
ExternalProject_Add(bot2-param
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-param
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-param
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
${INSTALL_CMD}
DEPENDS bot2-core)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-lcmgl;bot2-lcmgl;ALL;/")
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-param;bot2-param;ALL;/")
endif()

option(WITH_BOT_LCMGL "Build with bot2-lcmgl" ON)

cmake_dependent_option(WITH_BOT_FRAMES "Build with bot2-frames, requires bot2-lcmgl and bot2-param" ON "WITH_BOT_LCMGL AND WITH_BOT_PARAM" OFF)

ExternalProject_Add(bot2-frames
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-frames
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-frames
if(WITH_BOT_VIS)
message(STATUS "Configuring with bot2-vis, modules requiring GTK+ X11 will be built.")

ExternalProject_Add(bot2-vis
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-vis
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-vis
CMAKE_ARGS ${default_cmake_args}
LIST_SEPARATOR ":::"
${INSTALL_CMD}
DEPENDS bot2-core bot2-param bot2-lcmgl)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-frames;bot2-frames;ALL;/")
DEPENDS bot2-core)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-vis;bot2-vis;ALL;/")

if(WITH_BOT_LCMGL)
ExternalProject_Add(bot2-lcmgl
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-lcmgl
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-lcmgl
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args} -DUSE_BOT_VIS:BOOL=${WITH_BOT_VIS}
${INSTALL_CMD}
DEPENDS bot2-core bot2-vis)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-lcmgl;bot2-lcmgl;ALL;/")

if(WITH_BOT_FRAMES AND WITH_BOT_PARAM)
ExternalProject_Add(bot2-frames
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-frames
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-frames
LIST_SEPARATOR ":::"
CMAKE_ARGS ${default_cmake_args}
${INSTALL_CMD}
DEPENDS bot2-core bot2-param bot2-vis bot2-lcmgl)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-frames;bot2-frames;ALL;/")
endif()
endif()
else()
if(WITH_BOT_LCMGL)
message(STATUS "Configuring without bot2-vis, modules requiring GTK+ X11 will not be built.")
find_package(X11 REQUIRED )
find_package(ZLIB REQUIRED)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(GTK2 REQUIRED)
find_package(GLUT REQUIRED)

ExternalProject_Add(bot2-lcmgl
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-lcmgl
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-lcmgl
CMAKE_ARGS ${default_cmake_args} -DUSE_BOT_VIS:BOOL=${WITH_BOT_VIS}
LIST_SEPARATOR ":::"
${INSTALL_CMD}
DEPENDS bot2-core)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-lcmgl;bot2-lcmgl;ALL;/")

if(WITH_BOT_FRAMES AND WITH_BOT_PARAM)
ExternalProject_Add(bot2-frames
SOURCE_DIR ${PROJECT_SOURCE_DIR}/bot2-frames
BINARY_DIR ${PROJECT_BINARY_DIR}/bot2-frames
CMAKE_ARGS ${default_cmake_args}
LIST_SEPARATOR ":::"
${INSTALL_CMD}
DEPENDS bot2-core bot2-param bot2-lcmgl)
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PROJECT_BINARY_DIR}/bot2-frames;bot2-frames;ALL;/")
endif()
endif()
endif()

configure_file(cmake/${CMAKE_PROJECT_NAME}-config.cmake.in
Expand Down
3 changes: 3 additions & 0 deletions bot2-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ set(POD_NAME bot2-core)
set(NAMESPACE libbot2::)

option(BUILD_SHARED_LIBS "Build libraries as shared libraries" OFF)
if(NOT BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

include(cmake/pods.cmake)

Expand Down
19 changes: 10 additions & 9 deletions bot2-core/lcmtypes/bot_core_sensor_status_t.lcm
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ struct sensor_status_t
string sensor_name;
double rate;
int16_t type;
const int16_t VELODYNE_32 = 0;
const int16_t VELODYNE_64 = 1;
const int16_t SICK_LASER = 2;
const int16_t HOKUYO_LASER = 3;
const int16_t KINECT = 4;
const int16_t IMU = 5;
const int16_t ORC = 6;
const int16_t DYNAMIXEL_SERVO = 7;
}
const int16_t VELODYNE_16 = 0;
const int16_t VELODYNE_32 = 1;
const int16_t VELODYNE_64 = 2;
const int16_t SICK_LASER = 3;
const int16_t HOKUYO_LASER = 4;
const int16_t KINECT = 5;
const int16_t IMU = 6;
const int16_t ORC = 7;
const int16_t DYNAMIXEL_SERVO = 8;
}
3 changes: 3 additions & 0 deletions bot2-frames/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ set(POD_NAME bot2-frames)
set(NAMESPACE libbot2::)

option(BUILD_SHARED_LIBS "Build libraries as shared libraries" OFF)
if(NOT BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

include(cmake/pods.cmake)

Expand Down
2 changes: 1 addition & 1 deletion bot2-lcm-utils/bot-spy.sh.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
for d in . .. ../.. ../../.. ../../../.. "@CMAKE_INSTALL_PREFIX@"; do
if [ -d $d/share/java ]; then
jd=$d/share/java
Expand Down
2 changes: 0 additions & 2 deletions bot2-lcm-utils/python/src/bot_log2mat/log_to_mat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python
#
#Converts a LCM log to a "matrix" format that is easier to work with in external
#tools such as Matlab. The set of messages on a given channel can be represented
#as a matrix, where the columns of this matrix are the the fields of the lcm type
Expand Down
1 change: 0 additions & 1 deletion bot2-lcm-utils/python/src/bot_log2mat/scan_for_lcmtypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
import re
import os
import sys
Expand Down
3 changes: 3 additions & 0 deletions bot2-lcmgl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ set(POD_NAME bot2-lcmgl)
set(NAMESPACE libbot2::)

option(BUILD_SHARED_LIBS "Build libraries as shared libraries" OFF)
if(NOT BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

include(cmake/pods.cmake)

Expand Down
3 changes: 3 additions & 0 deletions bot2-param/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ set(POD_NAME bot2-param)
set(NAMESPACE libbot2::)

option(BUILD_SHARED_LIBS "Build libraries as shared libraries" OFF)
if(NOT BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

include(cmake/pods.cmake)
pods_config_search_paths()
Expand Down
2 changes: 1 addition & 1 deletion bot2-procman/python/scripts/bot-procman-sheriff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

from bot_procman.sheriff_gtk import sheriff_gtk
sheriff_gtk.main()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import os
import sys
Expand Down
3 changes: 3 additions & 0 deletions bot2-vis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set(POD_NAME bot2-vis)
set(NAMESPACE libbot2::)

option(BUILD_SHARED_LIBS "Build libraries as shared libraries" OFF)
if(NOT BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

list(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_SOURCE_DIR}/cmake/modules")
include(cmake/pods.cmake)
Expand Down
4 changes: 2 additions & 2 deletions bot2-vis/src/bot_vis/viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ on_button_press (GtkWidget *widget, GdkEventButton *event, void *user_data)
_window_coord_to_ray (event->x, widget->allocation.height - event->y, ray_start, ray_dir);

// find a new picker?
double best_distance = HUGE;
double best_distance = HUGE_VAL;
BotEventHandler *best_handler = NULL;

if (self->picking_handler == NULL || self->picking_handler->picking==0) {
Expand Down Expand Up @@ -683,7 +683,7 @@ on_motion_notify (GtkWidget *widget, GdkEventMotion *event, void *user_data)
if (self->picking_handler == NULL || !self->picking_handler->picking) {

// find a new hover?
double best_distance = HUGE;
double best_distance = HUGE_VAL;
BotEventHandler *best_handler = NULL;

for (unsigned int eidx = 0; eidx < self->event_handlers->len; eidx++) {
Expand Down
12 changes: 11 additions & 1 deletion cmake/cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,22 @@ set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${PAC
set(CPACK_STRIP_FILES TRUE)
set(CPACK_SOURCE_STRIP_FILES FALSE)

if(NOT DEFINED CPACK_OPEN_JRE_VERSION)
set(CPACK_OPEN_JRE_VERSION 8)
endif()

if(NOT DEFINED CPACK_LIBPNG_VERSION)
set(CPACK_LIBPNG_VERSION 12-0)
endif()
if(PACKAGE_OPENGL)
set(CPACK_OPENGL libopengl0, )
endif()
# Debian specific
set(CPACK_DEBIAN_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${MACHINE_ARCH})
set(CPACK_DEBIAN_PACKAGE_RELEASE ${PACKAGE_RELEASE_VERSION})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "lcm (>=1.3.95), freeglut3, libc6, libgcc1, libglib2.0-0, libglu1-mesa, libgtk2.0-0, libice6, libjpeg8, libpng12-0, libsm6, libstdc++6, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxmu6, libxt6, openjdk-8-jre, python, python-gtk2, python-numpy, python-scipy, zlib1g")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "lcm (>=1.3.95), freeglut3, ${CPACK_OPENGL} libc6, libgcc1, libglib2.0-0, libglu1-mesa, libgtk2.0-0, libice6, libjpeg8, libpng${CPACK_LIBPNG_VERSION}, libsm6, libstdc++6, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxmu6, libxt6, openjdk-${CPACK_OPEN_JRE_VERSION}-jre, python, python-gtk2, python-numpy, python-scipy, zlib1g")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RobotLocomotion/libbot2")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Francois Budin <francois.budin@kitware.com>")

Expand Down
Loading