Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

fix install tag #285

Open
wants to merge 10 commits into
base: kinetic
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMake
##############################################################################

cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(rosjava_core)

##############################################################################
Expand Down Expand Up @@ -30,5 +30,5 @@ catkin_package()
# Installation
##############################################################################

install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/rosjava_core/
install(DIRECTORY ${ROS_MAVEN_DEPLOYMENT_REPOSITORY}/org/ros/rosjava_core/
DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/rosjava_core)
1 change: 1 addition & 0 deletions apache_xmlrpc_common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
dependencies {
compile 'org.apache.commons:com.springsource.org.apache.commons.httpclient:3.1.0'
compile 'org.apache.ws.commons:ws-commons-util:1.0.1'
compile 'javax.xml.bind:jaxb-api:2.3.1'
}

7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ task wrapper(type: Wrapper) {
}

buildscript {
apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/kinetic/buildscript.gradle"
try{
apply from: "https://raw.githubusercontent.com/mojin-robotics/rosjava_bootstrap/kinetic/buildscript.gradle"
} catch (all) {
//local copy of rosjava_bootstrap buildscript.gradle
apply from: "buildscript.gradle"
}
}

apply plugin: "catkin"
Expand Down
55 changes: 55 additions & 0 deletions buildscript.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (C) 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

/*
* @fmessmer:
* This file is a copy from https://raw.githubusercontent.com/mojin-robotics/rosjava_bootstrap/kinetic/buildscript.gradle
* It is copied to allow temporary offline compilation
*/

rootProject.buildscript {
String rosMavenPath = System.getenv("ROS_MAVEN_PATH")
String rosMavenRepository = System.getenv("ROS_MAVEN_REPOSITORY")
repositories {
if (rosMavenPath != null) {
rosMavenPath.tokenize(":").each { path ->
maven {
// We can't use uri() here because we aren't running inside something
// that implements the Script interface.
url "file:${path}"
}
}
}
maven {
url "http://repository.springsource.com/maven/bundles/release"
}
maven {
url "http://repository.springsource.com/maven/bundles/external"
}
if (rosMavenRepository != null) {
maven {
url rosMavenRepository
}
}
maven {
url "https://github.com/rosjava/rosjava_mvn_repo/raw/master"
}
jcenter()
}
dependencies {
classpath "org.ros.rosjava_bootstrap:gradle_plugins:[0.3,0.4)"
}
}
26 changes: 13 additions & 13 deletions rosjava/test/test_composite_passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,37 @@ def cb_from_test(self, msg):
def test_composite_passthrough(self):
# 20 seconds to validate fixture
timeout_t = time.time() + 20.
print "waiting for 20 seconds for fixture to verify"
print("waiting for 20 seconds for fixture to verify")
while self.fixture_curr is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(timeout_t < time.time(), "timeout exceeded")
self.failIf(rospy.is_shutdown(), "node shutdown")
self.failIf(self.fixture_curr is None, "no data from fixture")
self.assertFalse(timeout_t < time.time(), "timeout exceeded")
self.assertFalse(rospy.is_shutdown(), "node shutdown")
self.assertFalse(self.fixture_curr is None, "no data from fixture")
m = self.fixture_curr
self.assertAlmostEquals(m.a.x, m.b.x)
self.assertAlmostEquals(m.a.y, m.b.y)
self.assertAlmostEquals(m.a.z, m.b.z)
self.assertAlmostEqual(m.a.x, m.b.x)
self.assertAlmostEqual(m.a.y, m.b.y)
self.assertAlmostEqual(m.a.z, m.b.z)

# another 20 seconds to validate client
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to verify"
print("waiting for 20 seconds for client to verify")
while self.test_curr is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(self.test_curr is None, "no data from test")
self.assertFalse(self.test_curr is None, "no data from test")
m = self.test_curr
self.assertAlmostEquals(m.a.x, m.b.x)
self.assertAlmostEquals(m.a.y, m.b.y)
self.assertAlmostEquals(m.a.z, m.b.z)
self.assertAlmostEqual(m.a.x, m.b.x)
self.assertAlmostEqual(m.a.y, m.b.y)
self.assertAlmostEqual(m.a.z, m.b.z)

# a.w = a.x + a.y + a.z. Just make sure we're in the ballpark
a = self.test_curr.a
self.assert_(abs(a.x + a.y + a.z - a.w) < 10.)
self.assertTrue(abs(a.x + a.y + a.z - a.w) < 10.)

if __name__ == '__main__':
import rostest
Expand Down
18 changes: 9 additions & 9 deletions rosjava/test/test_int64_passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ def cb_from_test(self, msg):
def test_int64_passthrough(self):
# 20 seconds to validate fixture
timeout_t = time.time() + 20.
print "waiting for 20 seconds for fixture to verify"
print("waiting for 20 seconds for fixture to verify")
while self.fixture_prev is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(timeout_t < time.time(), "timeout exceeded")
self.failIf(rospy.is_shutdown(), "node shutdown")
self.failIf(self.fixture_prev is None, "no data from fixture")
self.failIf(self.fixture_curr is None, "no data from fixture")
self.assertEquals(self.fixture_prev.data + 1, self.fixture_curr.data, "fixture should incr by one")
self.assertFalse(timeout_t < time.time(), "timeout exceeded")
self.assertFalse(rospy.is_shutdown(), "node shutdown")
self.assertFalse(self.fixture_prev is None, "no data from fixture")
self.assertFalse(self.fixture_curr is None, "no data from fixture")
self.assertEqual(self.fixture_prev.data + 1, self.fixture_curr.data, "fixture should incr by one")

# another 20 seconds to validate client
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to verify"
print("waiting for 20 seconds for client to verify")
while self.test_prev is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(self.test_prev is None, "no data from test")
self.assertEquals(self.test_prev.data + 1, self.test_curr.data, "test does not appear to match fixture data")
self.assertFalse(self.test_prev is None, "no data from test")
self.assertEqual(self.test_prev.data + 1, self.test_curr.data, "test does not appear to match fixture data")


if __name__ == '__main__':
Expand Down
52 changes: 26 additions & 26 deletions rosjava/test/test_parameter_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def tilde_cb(self, msg):

def test_parameter_client_read(self):
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to load"
print("waiting for 20 seconds for client to load")

tests = self.tests
msgs = [None]
Expand All @@ -95,36 +95,36 @@ def test_parameter_client_read(self):
time.sleep(0.2)
msgs = [getattr(self, t+'_msg') for t in tests]

print "msgs: %s"%(msgs)
print("msgs: %s"%(msgs))

self.failIf(timeout_t < time.time(), "timeout exceeded")
self.failIf(rospy.is_shutdown(), "node shutdown")
self.failIf(any(1 for m in msgs if m is None), "did not receive all expected messages: "+str(msgs))
self.assertFalse(timeout_t < time.time(), "timeout exceeded")
self.assertFalse(rospy.is_shutdown(), "node shutdown")
self.assertFalse(any(1 for m in msgs if m is None), "did not receive all expected messages: "+str(msgs))

ns = rospy.get_param('parameter_namespace')
for t in tests:
p_name = roslib.names.ns_join(ns, t)
value = rospy.get_param(p_name, t)
msg = getattr(self, "%s_msg"%(t))
print "get param: %s"%(p_name)
print "param value: %s"%(value)
print "msg value: %s"%(msg)
print("get param: %s"%(p_name))
print("param value: %s"%(value))
print("msg value: %s"%(msg))
if t == 'composite':
print "value", p_name, value
print("value", p_name, value)
m = Composite(CompositeA(**value['a']), CompositeB(**value['b']))
self.assertAlmostEquals(m.a.x, msg.a.x)
self.assertAlmostEquals(m.a.y, msg.a.y)
self.assertAlmostEquals(m.a.z, msg.a.z)
self.assertAlmostEquals(m.a.w, msg.a.w)
self.assertAlmostEquals(m.b.x, msg.b.x)
self.assertAlmostEquals(m.b.y, msg.b.y)
self.assertAlmostEquals(m.b.z, msg.b.z)
self.assertAlmostEqual(m.a.x, msg.a.x)
self.assertAlmostEqual(m.a.y, msg.a.y)
self.assertAlmostEqual(m.a.z, msg.a.z)
self.assertAlmostEqual(m.a.w, msg.a.w)
self.assertAlmostEqual(m.b.x, msg.b.x)
self.assertAlmostEqual(m.b.y, msg.b.y)
self.assertAlmostEqual(m.b.z, msg.b.z)
elif t == 'list':
self.assertEquals(list(value), list(msg.int32_array))
self.assertEqual(list(value), list(msg.int32_array))
elif t == 'float':
self.assertAlmostEquals(value, msg.data)
self.assertAlmostEqual(value, msg.data)
else:
self.assertEquals(value, msg.data)
self.assertEqual(value, msg.data)

def test_set_parameter(self):
# make sure client copied each parameter correct
Expand All @@ -137,23 +137,23 @@ def test_set_parameter(self):
source_value = rospy.get_param(source_name)
target_value = rospy.get_param(target_name)
if t != 'float':
self.assertEquals(source_value, target_value)
self.assertEqual(source_value, target_value)
else:
self.assertAlmostEquals(source_value, target_value)
self.assertAlmostEqual(source_value, target_value)

def test_tilde_parameter(self):
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to load"
print("waiting for 20 seconds for client to load")
while self.tilde_msg is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(timeout_t < time.time(), "timeout exceeded")
self.failIf(rospy.is_shutdown(), "node shutdown")
self.failIf(self.tilde_msg is None)
self.assertFalse(timeout_t < time.time(), "timeout exceeded")
self.assertFalse(rospy.is_shutdown(), "node shutdown")
self.assertFalse(self.tilde_msg is None)

self.assertEquals(rospy.get_param('param_client/tilde'), self.tilde_msg.data)
self.assertEqual(rospy.get_param('param_client/tilde'), self.tilde_msg.data)

if __name__ == '__main__':
import rostest
Expand Down
16 changes: 8 additions & 8 deletions rosjava/test/test_string_passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TestStringPassthrough(unittest.TestCase):

def setUp(self):
rospy.init_node(NAME)
self.nodes = ['/node%s'%(i) for i in xrange(10)]
self.nodes = ['/node%s'%(i) for i in range(10)]
self.nodes_set = set(self.nodes)

# keep track of nodes that have done callbacks
Expand All @@ -70,31 +70,31 @@ def cb_from_test(self, msg):
def test_string_passthrough(self):
# 20 seconds to validate fixture
timeout_t = time.time() + 20.
print "waiting for 20 seconds for fixture to verify"
print("waiting for 20 seconds for fixture to verify")
while not self.fixture_nodes_cb == self.nodes_set and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(timeout_t < time.time(), "timeout exceeded")
self.failIf(rospy.is_shutdown(), "node shutdown")
self.assertEquals(self.nodes_set, self.fixture_nodes_cb, "fixture did not validate: %s vs %s"%(self.nodes_set, self.fixture_nodes_cb))
self.assertFalse(timeout_t < time.time(), "timeout exceeded")
self.assertFalse(rospy.is_shutdown(), "node shutdown")
self.assertEqual(self.nodes_set, self.fixture_nodes_cb, "fixture did not validate: %s vs %s"%(self.nodes_set, self.fixture_nodes_cb))

# another 20 seconds to validate client
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to verify"
print("waiting for 20 seconds for client to verify")
while not self.test_nodes_cb == self.nodes_set and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.assertEquals(self.nodes_set, self.test_nodes_cb, "passthrough did not pass along all message")
self.assertEqual(self.nodes_set, self.test_nodes_cb, "passthrough did not pass along all message")

# Create a new Publisher here. This will validate publisherUpdate()
pub = rospy.Publisher('string_in', String)
msg = 'test_publisherUpdate'
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to verify"
print("waiting for 20 seconds for client to verify")
while not msg in self.nodes_set and \
not rospy.is_shutdown() and \
timeout_t > time.time():
Expand Down
22 changes: 11 additions & 11 deletions rosjava/test/test_testheader_passthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,32 @@ def cb_from_test(self, msg):
def test_testheader_passthrough(self):
# 20 seconds to validate fixture
timeout_t = time.time() + 20.
print "waiting for 20 seconds for fixture to verify"
print("waiting for 20 seconds for fixture to verify")
while self.fixture_curr is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(timeout_t < time.time(), "timeout exceeded")
self.failIf(rospy.is_shutdown(), "node shutdown")
self.failIf(self.fixture_curr is None, "no data from fixture")
self.assertEquals('/node0', self.fixture_curr.caller_id)
self.assertEquals('', self.fixture_curr.orig_caller_id)
self.assertFalse(timeout_t < time.time(), "timeout exceeded")
self.assertFalse(rospy.is_shutdown(), "node shutdown")
self.assertFalse(self.fixture_curr is None, "no data from fixture")
self.assertEqual('/node0', self.fixture_curr.caller_id)
self.assertEqual('', self.fixture_curr.orig_caller_id)

# another 20 seconds to validate client
timeout_t = time.time() + 20.
print "waiting for 20 seconds for client to verify"
print("waiting for 20 seconds for client to verify")
while self.test_curr is None and \
not rospy.is_shutdown() and \
timeout_t > time.time():
time.sleep(0.2)

self.failIf(self.test_curr is None, "no data from test")
self.assertEquals('/rosjava_node', self.test_curr.caller_id)
self.assertEquals('/node0', self.test_curr.orig_caller_id)
self.assertFalse(self.test_curr is None, "no data from test")
self.assertEqual('/rosjava_node', self.test_curr.caller_id)
self.assertEqual('/node0', self.test_curr.orig_caller_id)
t = self.test_curr.header.stamp.to_sec()
# be really generous here, just need to be in the ballpark.
self.assert_(abs(time.time() - t) < 60.)
self.assertTrue(abs(time.time() - t) < 60.)

if __name__ == '__main__':
import rostest
Expand Down
6 changes: 3 additions & 3 deletions rosjava_benchmarks/scripts/pubsub_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright (C) 2012 Google Inc.
#
Expand Down Expand Up @@ -32,7 +32,7 @@ def __init__(self):

def callback(self, _):
with self.lock:
self.count.next()
next(self.count)

def run(self):
tf_publisher = rospy.Publisher('tf', tf_msgs.tfMessage)
Expand All @@ -41,7 +41,7 @@ def run(self):
while not rospy.is_shutdown():
tf_publisher.publish(tf_msgs.tfMessage())
if (rospy.Time.now() - self.time) > rospy.Duration(5):
status_publisher.publish(std_msgs.String('%.2f Hz' % (self.count.next() / 5.0)))
status_publisher.publish(std_msgs.String('%.2f Hz' % (next(self.count) / 5.0)))
with self.lock:
self.count = itertools.count()
self.time = rospy.Time.now()
Expand Down
Loading