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

fix wrongly commited in #61 #63

Merged
merged 6 commits into from
Jan 15, 2019
Merged
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
26 changes: 19 additions & 7 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ sudo apt-get update -qq
sudo apt-get install -qq -y python-catkin-pkg python-rosdep python-wstool python-catkin-tools ros-$ROS_DISTRO-catkin
sudo rosdep init
rosdep update; while [ $? != 0 ]; do sleep 1; rosdep update; done
###
### theck if ${BUILDER} works for common messages
###
mkdir -p ~/ros/ws_$REPOSITORY_NAME/src
cd ~/ros/ws_$REPOSITORY_NAME/src
ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
Expand All @@ -40,31 +43,39 @@ rosdep install -q -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
# script:
source /opt/ros/$ROS_DISTRO/setup.bash
## on indigo we have to compile geneus before other packages..
if [ ${BUILDER} == "catkin_make" ]; then ${BUILDER} geneus $ROS_PARALLEL_JOBS; rm -fr build; source devel/setup.bash; fi
if [ "${BUILDER}" == "catkin_make" ]; then ${BUILDER} geneus $ROS_PARALLEL_JOBS; rm -fr build; source devel/setup.bash; fi
${BUILDER} $ROS_PARALLEL_JOBS
## test for roseus
sudo apt-get install -qq -y ros-${ROS_DISTRO}-roseus
sudo dpkg -r --force-depends ros-${ROS_DISTRO}-geneus
###
### theck if ${BUILDER} works with test code
###
## need to use latest test codes
rm -fr devel build src/*
cd src
# clone only roseus package
git clone http://github.com/jsk-ros-pkg/jsk_roseus /tmp/jsk_roseus
(cd /tmp/jsk_roseus; git checkout `git describe --abbrev=0 --tags`)
cp -r /tmp/jsk_roseus/roseus ./
# clone std_msgs which is required by test codes
git clone https://github.com/ros-gbp/std_msgs-release.git std_msgs -b release/${ROS_DISTRO}/std_msgs
# copy geneus package
##- sudo wget https://raw.githubusercontent.com/k-okada/jsk_roseus/fix_generate_all/roseus/scripts/generate-all-msg-srv.sh -O /opt/ros/hydro/share/roseus/scripts/generate-all-msg-srv.sh
ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
cd ..
## check roseus
source /opt/ros/$ROS_DISTRO/setup.bash
rm -fr build devel # need to clean up to check #42 case
if [ ${BUILDER} == "catkin_make" ]; then ${BUILDER} --only-pkg-with-deps geneus $ROS_PARALLEL_JOBS; rm -fr build; source devel/setup.bash; fi
if [ "${BUILDER}" == "catkin_make" ]; then ${BUILDER} --only-pkg-with-deps geneus $ROS_PARALLEL_JOBS; rm -fr build; source devel/setup.bash; fi
if [ "${BUILDER}" == "catkin build" ]; then ${BUILDER} geneus $ROS_PARALLEL_JOBS; source devel/setup.bash; fi
${BUILDER}
source devel*/setup.bash
if [ ${BUILDER} == "catkin_make_isolated" ] ; then cat devel_isolated/roseus/share/roseus/ros/roseus/manifest.l; fi
if [ ${BUILDER} != "catkin_make_isolated" ] ; then cat devel/share/roseus/ros/roseus/manifest.l; fi
if [ "${BUILDER}" == "catkin_make_isolated" ] ; then cat devel_isolated/roseus/share/roseus/ros/roseus/manifest.l; fi
if [ "${BUILDER}" != "catkin_make_isolated" ] ; then cat devel/share/roseus/ros/roseus/manifest.l; fi
## check https://github.com/jsk-ros-pkg/geneus/pull/42
if [ ${BUILDER} == "catkin_make_isolated" ] ; then [ `grep -c -e "/opt/ros/${ROS_DISTRO}/share/roseus/package.xml" devel_isolated/roseus/share/roseus/ros/roseus/manifest.l` != 1 ]; fi
if [ ${BUILDER} != "catkin_make_isolated" ] ; then [ `grep -c -e "/opt/ros/${ROS_DISTRO}/share/roseus/package.xml" devel/share/roseus/ros/roseus/manifest.l` != 1 ]; fi
if [ "${BUILDER}" == "catkin_make_isolated" ] ; then [ `grep -c -e "/opt/ros/${ROS_DISTRO}/share/roseus/package.xml" devel_isolated/roseus/share/roseus/ros/roseus/manifest.l` != 1 ]; fi
if [ "${BUILDER}" != "catkin_make_isolated" ] ; then [ `grep -c -e "/opt/ros/${ROS_DISTRO}/share/roseus/package.xml" devel/share/roseus/ros/roseus/manifest.l` != 1 ]; fi
rostest geneus test-geneus.test
rostest roseus test-genmsg.catkin.test
rostest roseus test-genmsg-oneworkspace.catkin.launch
Expand All @@ -76,7 +87,8 @@ rosdep install -q -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
sudo dpkg -r --force-depends ros-${ROS_DISTRO}-geneus
rm -fr build devel install logs .catkin*
source /opt/ros/$ROS_DISTRO/setup.bash
if [ ${BUILDER} == "catkin_make" ]; then ${BUILDER} --only-pkg-with-deps geneus $ROS_PARALLEL_JOBS; rm -fr build; source devel/setup.bash; fi
if [ "${BUILDER}" == "catkin_make" ]; then ${BUILDER} --only-pkg-with-deps geneus $ROS_PARALLEL_JOBS; rm -fr build; source devel/setup.bash; fi
if [ "${BUILDER}" == "catkin build" ]; then ${BUILDER} geneus $ROS_PARALLEL_JOBS; source devel/setup.bash; fi
${BUILDER}
source devel*/setup.bash
rostest pr2eus default-ri-test.test
Expand Down
13 changes: 7 additions & 6 deletions src/geneus/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,13 @@ def write_accessors(s, spec):
s.write('(:%s'%field.name)
var = '_%s'%field.name
with Indent(s, inc=1):
if field.is_builtin and field.type == "bool":
s.write('(&optional _%s)'%var)
s.write('(if _%s (setq %s _%s)) %s)'%(var,var,var,var))
elif field.type == "bool":
s.write('(&optional (_%s :null))'%var)
s.write('(if (not (eq _%s :null)) (setq %s _%s)) %s)'%(var,var,var,var))
if field.is_builtin:
if field.type == "bool":
s.write('(&optional (_%s :null))'%var)
s.write('(if (not (eq _%s :null)) (setq %s _%s)) %s)'%(var,var,var,var))
else:
s.write('(&optional _%s)'%var)
s.write('(if _%s (setq %s _%s)) %s)'%(var,var,var,var))
else:
s.write('(&rest _%s)'%var)
s.write('(if (keywordp (car _%s))'%var)
Expand Down
4 changes: 2 additions & 2 deletions test/test-geneus.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<launch>
<node name="send_msgs" pkg="roseus" type="test_geneus_send_msgs.py" />
<test test-name="test_geneus" pkg="roseus" type="roseus" args="$(find roseus)/test/test-geneus.l" />
<node name="send_msgs" pkg="geneus" type="test_geneus_send_msgs.py" />
<test test-name="test_geneus" pkg="roseus" type="roseus" args="$(find geneus)/test/test-geneus.l" />
</launch>