This repository has been archived by the owner on Jan 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packet readed with genjava scripts filled with stubs.
- Loading branch information
Showing
10 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
############################################################################## | ||
# CMake | ||
############################################################################## | ||
|
||
cmake_minimum_required(VERSION 2.8.3) | ||
project(genjava) | ||
|
||
############################################################################## | ||
# Dependencies | ||
############################################################################## | ||
|
||
find_package(catkin REQUIRED COMPONENTS genmsg) | ||
|
||
############################################################################## | ||
# Package | ||
############################################################################## | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS genmsg | ||
CFG_EXTRAS genjava-extras.cmake | ||
) | ||
|
||
add_subdirectory(scripts) | ||
|
||
message(STATUS "GENMSG_LANGS_DESTINATION...........${GENMSG_LANGS_DESTINATION}") | ||
file(WRITE ${CATKIN_DEVEL_PREFIX}/${GENMSG_LANGS_DESTINATION}/genjava "Java") | ||
install(FILES ${CATKIN_DEVEL_PREFIX}/${GENMSG_LANGS_DESTINATION}/genjava | ||
DESTINATION ${GENMSG_LANGS_DESTINATION}) | ||
|
||
catkin_python_setup() | ||
|
||
if(CATKIN_ENABLE_TESTING) | ||
catkin_add_nosetests(test) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
@[if DEVELSPACE]@ | ||
# location of scripts in develspace | ||
set(GENJAVA_BIN_DIR "@(CMAKE_CURRENT_SOURCE_DIR)/scripts") | ||
@[else]@ | ||
# location of scripts in installspace | ||
set(GENJAVA_BIN_DIR "${GENJAVA_DIR}/../../../@(CATKIN_PACKAGE_BIN_DESTINATION)") | ||
@[end if]@ | ||
|
||
set(GENMSG_JAVA_BIN ${GENJAVA_BIN_DIR}/genmsg_java.py) | ||
set(GENSRV_JAVA_BIN ${GENJAVA_BIN_DIR}/gensrv_java.py) | ||
|
||
# Generate .msg->.h for py | ||
# The generated .h files should be added ALL_GEN_OUTPUT_FILES_py | ||
macro(_generate_msg_java ARG_PKG ARG_MSG ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR) | ||
|
||
message(STATUS "GEN_MSG_JAVA..........._generate_msg_java") | ||
message(STATUS " ARG_PKG..............${ARG_PKG}") | ||
message(STATUS " ARG_MSG..............${ARG_MSG}") | ||
message(STATUS " ARG_IFLAGS...........${ARG_IFLAGS}") | ||
message(STATUS " ARG_MSG_DEPS.........${ARG_MSG_DEPS}") | ||
message(STATUS " ARG_GEN_OUTPUT_DIR...${ARG_GEN_OUTPUT_DIR}") | ||
|
||
#Append msg to output dir | ||
# set(GEN_OUTPUT_DIR "${ARG_GEN_OUTPUT_DIR}/msg") | ||
# file(MAKE_DIRECTORY ${GEN_OUTPUT_DIR}) | ||
#Create input and output filenames | ||
# get_filename_component(MSG_SHORT_NAME ${ARG_MSG} NAME_WE) | ||
# | ||
# set(MSG_GENERATED_NAME _${MSG_SHORT_NAME}.py) | ||
# set(GEN_OUTPUT_FILE ${GEN_OUTPUT_DIR}/${MSG_GENERATED_NAME}) | ||
# | ||
# add_custom_command(OUTPUT ${GEN_OUTPUT_FILE} | ||
# DEPENDS ${GENMSG_PY_BIN} ${ARG_MSG} ${ARG_MSG_DEPS} | ||
# COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${GENMSG_PY_BIN} ${ARG_MSG} | ||
# ${ARG_IFLAGS} | ||
# -p ${ARG_PKG} | ||
# -o ${GEN_OUTPUT_DIR} | ||
# COMMENT "Generating Python from MSG ${ARG_PKG}/${MSG_SHORT_NAME}" | ||
# ) | ||
# | ||
# list(APPEND ALL_GEN_OUTPUT_FILES_py ${GEN_OUTPUT_FILE}) | ||
|
||
endmacro() | ||
|
||
#todo, these macros are practically equal. Check for input file extension instead | ||
macro(_generate_srv_java ARG_PKG ARG_SRV ARG_IFLAGS ARG_MSG_DEPS ARG_GEN_OUTPUT_DIR) | ||
|
||
message(STATUS "GEN_SRV_JAVA..........._generate_srv_java") | ||
#Append msg to output dir | ||
# set(GEN_OUTPUT_DIR "${ARG_GEN_OUTPUT_DIR}/srv") | ||
# file(MAKE_DIRECTORY ${GEN_OUTPUT_DIR}) | ||
# | ||
#Create input and output filenames | ||
# get_filename_component(SRV_SHORT_NAME ${ARG_SRV} NAME_WE) | ||
# | ||
# set(SRV_GENERATED_NAME _${SRV_SHORT_NAME}.py) | ||
# set(GEN_OUTPUT_FILE ${GEN_OUTPUT_DIR}/${SRV_GENERATED_NAME}) | ||
# | ||
# add_custom_command(OUTPUT ${GEN_OUTPUT_FILE} | ||
# DEPENDS ${GENSRV_PY_BIN} ${ARG_SRV} ${ARG_MSG_DEPS} | ||
# COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${GENSRV_PY_BIN} ${ARG_SRV} | ||
# ${ARG_IFLAGS} | ||
# -p ${ARG_PKG} | ||
# -o ${GEN_OUTPUT_DIR} | ||
# COMMENT "Generating Python code from SRV ${ARG_PKG}/${SRV_SHORT_NAME}" | ||
# ) | ||
# | ||
# list(APPEND ALL_GEN_OUTPUT_FILES_py ${GEN_OUTPUT_FILE}) | ||
|
||
endmacro() | ||
|
||
macro(_generate_module_java ARG_PKG ARG_GEN_OUTPUT_DIR ARG_GENERATED_FILES) | ||
|
||
message(STATUS "GEN_MODULE_PY..........._generate_module_py") | ||
# generate empty __init__ to make parent folder of msg/srv a python module | ||
if(NOT EXISTS ${ARG_GEN_OUTPUT_DIR}/__init__.py) | ||
file(WRITE ${ARG_GEN_OUTPUT_DIR}/__init__.py "") | ||
endif() | ||
|
||
#Append msg to output dir | ||
foreach(type "msg" "srv") | ||
set(GEN_OUTPUT_DIR "${ARG_GEN_OUTPUT_DIR}/${type}") | ||
set(GEN_OUTPUT_FILE ${GEN_OUTPUT_DIR}/__init__.py) | ||
|
||
if(IS_DIRECTORY ${GEN_OUTPUT_DIR}) | ||
add_custom_command(OUTPUT ${GEN_OUTPUT_FILE} | ||
DEPENDS ${GENMSG_PY_BIN} ${ARG_GENERATED_FILES} | ||
COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${GENMSG_PY_BIN} | ||
-o ${GEN_OUTPUT_DIR} | ||
--initpy | ||
COMMENT "Generating Python ${type} __init__.py for ${ARG_PKG}") | ||
list(APPEND ALL_GEN_OUTPUT_FILES_py ${GEN_OUTPUT_FILE}) | ||
endif() | ||
|
||
endforeach() | ||
|
||
endmacro() | ||
|
||
if(NOT EXISTS @(PROJECT_NAME)_SOURCE_DIR) | ||
set(GENJAVA_INSTALL_DIR ${PYTHON_INSTALL_DIR}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<package> | ||
<name>genjava</name> | ||
<version>0.1.0</version> | ||
<description> | ||
Java ROS message and service generators. | ||
</description> | ||
|
||
<license>BSD</license> | ||
|
||
<url type="website">http://www.ros.org/wiki/genjava</url> | ||
<url type="repository">https://github.com/rosjava/genjava</url> | ||
<url type="bugtracker">https://github.com/rosjava/genjava/issues</url> | ||
|
||
<maintainer email="[email protected]">Daniel Stonier</maintainer> | ||
|
||
<author>Daniel Stonier</author> | ||
|
||
<buildtool_depend version_gte="0.5.78">catkin</buildtool_depend> | ||
|
||
<build_depend>genmsg</build_depend> | ||
|
||
<run_depend>genmsg</run_depend> | ||
|
||
<export> | ||
<message_generator>java</message_generator> | ||
<rosdoc config="rosdoc.yaml"/> | ||
<architecture_independent/> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- builder: sphinx | ||
sphinx_root_dir: doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
catkin_install_python( | ||
PROGRAMS genmsg_java.py gensrv_java.py | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python | ||
|
||
from distutils.core import setup | ||
from catkin_pkg.python_setup import generate_distutils_setup | ||
|
||
d = generate_distutils_setup( | ||
packages=['genjava'], | ||
package_dir={'': 'src'}, | ||
requires=['genmsg'] | ||
) | ||
|
||
setup(**d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Software License Agreement (BSD License) | ||
# | ||
# Copyright (c) 2014, Daniel Stonier | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above | ||
# copyright notice, this list of conditions and the following | ||
# disclaimer in the documentation and/or other materials provided | ||
# with the distribution. | ||
# * Neither the name of Willow Garage, Inc. nor the names of its | ||
# contributors may be used to endorse or promote products derived | ||
# from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
|
||
#from . rostime import Time, Duration, TVal | ||
#from . message import Message, SerializationError, DeserializationError, MessageException, struct_I | ||
|
||
#__all__ = ['Time', 'Duration', 'TVal', | ||
# 'Message', 'SerializationError', 'DeserializationError', 'MessageException', 'struct_I'] |
Empty file.