new file: src/geometry2/geometry2/CMakeLists.txt new file: src/geometry2/geometry2/package.xml new file: src/geometry2/test_tf2/CHANGELOG.rst new file: src/geometry2/test_tf2/CMakeLists.txt new file: src/geometry2/test_tf2/mainpage.dox new file: src/geometry2/test_tf2/package.xml new file: src/geometry2/test_tf2/test/buffer_client_tester.launch new file: src/geometry2/test_tf2/test/buffer_core_test.cpp new file: src/geometry2/test_tf2/test/static_publisher.launch new file: src/geometry2/test_tf2/test/test_buffer_client.cpp new file: src/geometry2/test_tf2/test/test_buffer_client.py new file: src/geometry2/test_tf2/test/test_buffer_server.cpp new file: src/geometry2/test_tf2/test/test_convert.cpp new file: src/geometry2/test_tf2/test/test_convert.py new file: src/geometry2/test_tf2/test/test_message_filter.cpp new file: src/geometry2/test_tf2/test/test_static_publisher.cpp new file: src/geometry2/test_tf2/test/test_static_publisher.py new file: src/geometry2/test_tf2/test/test_tf2_bullet.cpp new file: src/geometry2/test_tf2/test/test_tf2_bullet.launch new file: src/geometry2/test_tf2/test/test_tf_invalid.yaml new file: src/geometry2/test_tf2/test/test_tf_valid.yaml new file: src/geometry2/test_tf2/test/test_utils.cpp new file: src/geometry2/tf2/CHANGELOG.rst new file: src/geometry2/tf2/CMakeLists.txt new file: src/geometry2/tf2/include/tf2/LinearMath/Matrix3x3.h new file: src/geometry2/tf2/include/tf2/LinearMath/MinMax.h new file: src/geometry2/tf2/include/tf2/LinearMath/QuadWord.h new file: src/geometry2/tf2/include/tf2/LinearMath/Quaternion.h new file: src/geometry2/tf2/include/tf2/LinearMath/Scalar.h new file: src/geometry2/tf2/include/tf2/LinearMath/Transform.h new file: src/geometry2/tf2/include/tf2/LinearMath/Vector3.h new file: src/geometry2/tf2/include/tf2/buffer_core.h new file: src/geometry2/tf2/include/tf2/convert.h new file: src/geometry2/tf2/include/tf2/exceptions.h new file: src/geometry2/tf2/include/tf2/impl/convert.h new file: src/geometry2/tf2/include/tf2/impl/utils.h new file: src/geometry2/tf2/include/tf2/time_cache.h new file: src/geometry2/tf2/include/tf2/transform_datatypes.h new file: src/geometry2/tf2/include/tf2/transform_storage.h new file: src/geometry2/tf2/include/tf2/utils.h new file: src/geometry2/tf2/index.rst new file: src/geometry2/tf2/mainpage.dox new file: src/geometry2/tf2/package.xml new file: src/geometry2/tf2/src/buffer_core.cpp new file: src/geometry2/tf2/src/cache.cpp new file: src/geometry2/tf2/src/static_cache.cpp new file: src/geometry2/tf2/test/cache_unittest.cpp new file: src/geometry2/tf2/test/simple_tf2_core.cpp new file: src/geometry2/tf2/test/speed_test.cpp new file: src/geometry2/tf2/test/static_cache_test.cpp new file: src/geometry2/tf2_bullet/CHANGELOG.rst new file: src/geometry2/tf2_bullet/CMakeLists.txt new file: src/geometry2/tf2_bullet/include/tf2_bullet/tf2_bullet.h new file: src/geometry2/tf2_bullet/include/tf2_bullet/tf2_bullet/tf2_bullet.h new file: src/geometry2/tf2_bullet/mainpage.dox new file: src/geometry2/tf2_bullet/package.xml new file: src/geometry2/tf2_bullet/test/test_tf2_bullet.cpp new file: src/geometry2/tf2_eigen/CHANGELOG.rst new file: src/geometry2/tf2_eigen/CMakeLists.txt new file: src/geometry2/tf2_eigen/include/tf2_eigen/tf2_eigen.h new file: src/geometry2/tf2_eigen/mainpage.dox new file: src/geometry2/tf2_eigen/package.xml new file: src/geometry2/tf2_eigen/test/tf2_eigen-test.cpp new file: src/geometry2/tf2_geometry_msgs/CHANGELOG.rst new file: src/geometry2/tf2_geometry_msgs/CMakeLists.txt new file: src/geometry2/tf2_geometry_msgs/conf.py new file: src/geometry2/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.h new file: src/geometry2/tf2_geometry_msgs/index.rst new file: src/geometry2/tf2_geometry_msgs/mainpage.dox new file: src/geometry2/tf2_geometry_msgs/package.xml new file: src/geometry2/tf2_geometry_msgs/rosdoc.yaml new file: src/geometry2/tf2_geometry_msgs/scripts/test.py new file: src/geometry2/tf2_geometry_msgs/setup.py new file: src/geometry2/tf2_geometry_msgs/src/tf2_geometry_msgs/__init__.py new file: src/geometry2/tf2_geometry_msgs/src/tf2_geometry_msgs/tf2_geometry_msgs.py new file: src/geometry2/tf2_geometry_msgs/test/test.launch new file: src/geometry2/tf2_geometry_msgs/test/test_python.launch new file: src/geometry2/tf2_geometry_msgs/test/test_tf2_geometry_msgs.cpp new file: src/geometry2/tf2_geometry_msgs/test/test_tomsg_frommsg.cpp new file: src/geometry2/tf2_kdl/CHANGELOG.rst new file: src/geometry2/tf2_kdl/CMakeLists.txt new file: src/geometry2/tf2_kdl/conf.py new file: src/geometry2/tf2_kdl/include/tf2_kdl/tf2_kdl.h new file: src/geometry2/tf2_kdl/include/tf2_kdl/tf2_kdl/tf2_kdl.h new file: src/geometry2/tf2_kdl/index.rst new file: src/geometry2/tf2_kdl/mainpage.dox new file: src/geometry2/tf2_kdl/package.xml new file: src/geometry2/tf2_kdl/rosdoc.yaml new file: src/geometry2/tf2_kdl/scripts/test.py new file: src/geometry2/tf2_kdl/setup.py new file: src/geometry2/tf2_kdl/src/tf2_kdl/__init__.py new file: src/geometry2/tf2_kdl/src/tf2_kdl/tf2_kdl.py new file: src/geometry2/tf2_kdl/test/test.launch new file: src/geometry2/tf2_kdl/test/test_python.launch new file: src/geometry2/tf2_kdl/test/test_tf2_kdl.cpp new file: src/geometry2/tf2_msgs/CHANGELOG.rst new file: src/geometry2/tf2_msgs/CMakeLists.txt new file: src/geometry2/tf2_msgs/action/LookupTransform.action new file: src/geometry2/tf2_msgs/include/foo new file: src/geometry2/tf2_msgs/mainpage.dox new file: src/geometry2/tf2_msgs/msg/TF2Error.msg new file: src/geometry2/tf2_msgs/msg/TFMessage.msg new file: src/geometry2/tf2_msgs/package.xml new file: src/geometry2/tf2_msgs/srv/FrameGraph.srv new file: src/geometry2/tf2_py/CHANGELOG.rst new file: src/geometry2/tf2_py/CMakeLists.txt new file: src/geometry2/tf2_py/package.xml new file: src/geometry2/tf2_py/setup.py new file: src/geometry2/tf2_py/src/python_compat.h new file: src/geometry2/tf2_py/src/tf2_py.cpp new file: src/geometry2/tf2_py/src/tf2_py/__init__.py new file: src/geometry2/tf2_ros/CHANGELOG.rst new file: src/geometry2/tf2_ros/CMakeLists.txt new file: src/geometry2/tf2_ros/doc/conf.py new file: src/geometry2/tf2_ros/doc/index.rst new file: src/geometry2/tf2_ros/doc/mainpage.dox new file: src/geometry2/tf2_ros/doc/tf2_ros.rst new file: src/geometry2/tf2_ros/include/tf2_ros/buffer.h new file: src/geometry2/tf2_ros/include/tf2_ros/buffer_client.h new file: src/geometry2/tf2_ros/include/tf2_ros/buffer_interface.h new file: src/geometry2/tf2_ros/include/tf2_ros/buffer_server.h new file: src/geometry2/tf2_ros/include/tf2_ros/message_filter.h new file: src/geometry2/tf2_ros/include/tf2_ros/static_transform_broadcaster.h new file: src/geometry2/tf2_ros/include/tf2_ros/transform_broadcaster.h new file: src/geometry2/tf2_ros/include/tf2_ros/transform_listener.h new file: src/geometry2/tf2_ros/package.xml new file: src/geometry2/tf2_ros/rosdoc.yaml new file: src/geometry2/tf2_ros/setup.py new file: src/geometry2/tf2_ros/src/buffer.cpp new file: src/geometry2/tf2_ros/src/buffer_client.cpp new file: src/geometry2/tf2_ros/src/buffer_server.cpp new file: src/geometry2/tf2_ros/src/buffer_server_main.cpp new file: src/geometry2/tf2_ros/src/static_transform_broadcaster.cpp new file: src/geometry2/tf2_ros/src/static_transform_broadcaster_program.cpp new file: src/geometry2/tf2_ros/src/tf2_ros/__init__.py new file: src/geometry2/tf2_ros/src/tf2_ros/buffer.py new file: src/geometry2/tf2_ros/src/tf2_ros/buffer_client.py new file: src/geometry2/tf2_ros/src/tf2_ros/buffer_interface.py new file: src/geometry2/tf2_ros/src/tf2_ros/static_transform_broadcaster.py new file: src/geometry2/tf2_ros/src/tf2_ros/transform_broadcaster.py new file: src/geometry2/tf2_ros/src/tf2_ros/transform_listener.py new file: src/geometry2/tf2_ros/src/transform_broadcaster.cpp new file: src/geometry2/tf2_ros/src/transform_listener.cpp new file: src/geometry2/tf2_ros/test/listener_unittest.cpp new file: src/geometry2/tf2_ros/test/message_filter_test.cpp new file: src/geometry2/tf2_ros/test/message_filter_test.launch new file: src/geometry2/tf2_ros/test/time_reset_test.cpp new file: src/geometry2/tf2_ros/test/transform_listener_time_reset_test.launch new file: src/geometry2/tf2_ros/test/transform_listener_unittest.launch new file: src/geometry2/tf2_sensor_msgs/CHANGELOG.rst new file: src/geometry2/tf2_sensor_msgs/CMakeLists.txt new file: src/geometry2/tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.h new file: src/geometry2/tf2_sensor_msgs/package.xml new file: src/geometry2/tf2_sensor_msgs/setup.py new file: src/geometry2/tf2_sensor_msgs/src/tf2_sensor_msgs/__init__.py new file: src/geometry2/tf2_sensor_msgs/src/tf2_sensor_msgs/tf2_sensor_msgs.py new file: src/geometry2/tf2_sensor_msgs/test/test.launch new file: src/geometry2/tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp new file: src/geometry2/tf2_sensor_msgs/test/test_tf2_sensor_msgs.py new file: src/geometry2/tf2_tools/CHANGELOG.rst new file: src/geometry2/tf2_tools/CMakeLists.txt new file: src/geometry2/tf2_tools/mainpage.dox new file: src/geometry2/tf2_tools/package.xml new file: src/geometry2/tf2_tools/scripts/echo.py new file: src/geometry2/tf2_tools/scripts/view_frames.py modified: src/maintain/scripts/test.py
226 lines
7.2 KiB
C++
226 lines
7.2 KiB
C++
/*
|
|
* Copyright (c) 2010, Willow Garage, Inc.
|
|
* 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 the 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.
|
|
*/
|
|
|
|
#include <tf2/buffer_core.h>
|
|
|
|
#include <ros/time.h>
|
|
#include <console_bridge/console.h>
|
|
|
|
#include <boost/lexical_cast.hpp>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
uint32_t num_levels = 10;
|
|
if (argc > 1)
|
|
{
|
|
num_levels = boost::lexical_cast<uint32_t>(argv[1]);
|
|
}
|
|
double time_interval = 1.0;
|
|
if (argc > 2)
|
|
{
|
|
time_interval = boost::lexical_cast<double>(argv[2]);
|
|
}
|
|
|
|
console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_INFO);
|
|
|
|
tf2::BufferCore bc;
|
|
geometry_msgs::TransformStamped t;
|
|
t.header.stamp = ros::Time(1);
|
|
t.header.frame_id = "root";
|
|
t.child_frame_id = "0";
|
|
t.transform.translation.x = 1;
|
|
t.transform.rotation.w = 1.0;
|
|
bc.setTransform(t, "me");
|
|
t.header.stamp = ros::Time(2);
|
|
bc.setTransform(t, "me");
|
|
|
|
for (uint32_t i = 1; i < num_levels / 2; ++i)
|
|
{
|
|
for (double j = time_interval; j < 2.0 + time_interval; j += time_interval)
|
|
{
|
|
std::stringstream parent_ss;
|
|
parent_ss << (i - 1);
|
|
std::stringstream child_ss;
|
|
child_ss << i;
|
|
|
|
t.header.stamp = ros::Time(j);
|
|
t.header.frame_id = parent_ss.str();
|
|
t.child_frame_id = child_ss.str();
|
|
bc.setTransform(t, "me");
|
|
}
|
|
}
|
|
|
|
t.header.frame_id = "root";
|
|
std::stringstream ss;
|
|
ss << num_levels/2;
|
|
t.header.stamp = ros::Time(1);
|
|
t.child_frame_id = ss.str();
|
|
bc.setTransform(t, "me");
|
|
t.header.stamp = ros::Time(2);
|
|
bc.setTransform(t, "me");
|
|
|
|
for (uint32_t i = num_levels/2 + 1; i < num_levels; ++i)
|
|
{
|
|
for (double j = time_interval; j < 2.0 + time_interval; j += time_interval)
|
|
{
|
|
std::stringstream parent_ss;
|
|
parent_ss << (i - 1);
|
|
std::stringstream child_ss;
|
|
child_ss << i;
|
|
|
|
t.header.stamp = ros::Time(j);
|
|
t.header.frame_id = parent_ss.str();
|
|
t.child_frame_id = child_ss.str();
|
|
bc.setTransform(t, "me");
|
|
}
|
|
}
|
|
|
|
//logInfo_STREAM(bc.allFramesAsYAML());
|
|
|
|
std::string v_frame0 = boost::lexical_cast<std::string>(num_levels - 1);
|
|
std::string v_frame1 = boost::lexical_cast<std::string>(num_levels/2 - 1);
|
|
CONSOLE_BRIDGE_logInform("%s to %s", v_frame0.c_str(), v_frame1.c_str());
|
|
geometry_msgs::TransformStamped out_t;
|
|
|
|
const uint32_t count = 1000000;
|
|
CONSOLE_BRIDGE_logInform("Doing %d %d-level %lf-interval tests", count, num_levels, time_interval);
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
out_t = bc.lookupTransform(v_frame1, v_frame0, ros::Time(0));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("lookupTransform at Time(0) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
out_t = bc.lookupTransform(v_frame1, v_frame0, ros::Time(1));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("lookupTransform at Time(1) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
out_t = bc.lookupTransform(v_frame1, v_frame0, ros::Time(1.5));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("lookupTransform at Time(1.5) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
out_t = bc.lookupTransform(v_frame1, v_frame0, ros::Time(2));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("lookupTransform at Time(2) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
bc.canTransform(v_frame1, v_frame0, ros::Time(0));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("canTransform at Time(0) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
bc.canTransform(v_frame1, v_frame0, ros::Time(1));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("canTransform at Time(1) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
bc.canTransform(v_frame1, v_frame0, ros::Time(1.5));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("canTransform at Time(1.5) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
|
|
#if 01
|
|
{
|
|
ros::WallTime start = ros::WallTime::now();
|
|
for (uint32_t i = 0; i < count; ++i)
|
|
{
|
|
bc.canTransform(v_frame1, v_frame0, ros::Time(2));
|
|
}
|
|
ros::WallTime end = ros::WallTime::now();
|
|
ros::WallDuration dur = end - start;
|
|
//ROS_INFO_STREAM(out_t);
|
|
CONSOLE_BRIDGE_logInform("canTransform at Time(2) took %f for an average of %.9f", dur.toSec(), dur.toSec() / (double)count);
|
|
}
|
|
#endif
|
|
}
|