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

Migrate rtt_tf to tf2 #121

Merged
merged 13 commits into from
May 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
4 changes: 2 additions & 2 deletions rtt_tf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ orocos_install_headers(include/rtt_tf/tf_interface.h)

orocos_generate_package(
INCLUDE_DIRS include
DEPENDS tf
DEPENDS_TARGETS rtt_roscomm rtt_geometry_msgs
DEPENDS tf tf2
DEPENDS_TARGETS rtt_roscomm rtt_geometry_msgs rtt_tf2_msgs
)

# Tests
Expand Down
8 changes: 4 additions & 4 deletions rtt_tf/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
RTT TF
======

This package provides an Orocos RTT component for utilizing the TF rigid body
transform library from within Orocos. This component provides a "tf" service
This package provides an Orocos RTT component for utilizing the [TF2 rigid body
transform library](http://wiki.ros.org/tf2) from within Orocos. This component provides a "tf" service
with operations for requesting and broadcasting sing and batch transforms.

### Usage

In general, a given process only needs a single TF component. This component
In general, a given process only needs a single TF2 component. This component
provides the following operations both on its bare interface and also on the
provided "tf" RTT service.

Expand Down Expand Up @@ -47,7 +47,7 @@ connectServices("my_component","tf");

The [rtt\_tf/tf\_interface.h](include/rtt_tf/tf_interface.h) header includes the
`rtt_tf::TFInterface` class which adds a required service to a given RTT
component. This can be used for more easily connecting with the TF component.
component. This can be used for more easily connecting with the TF2 component.

It can be used to create the RTT service requester "tf" like so:

Expand Down
16 changes: 14 additions & 2 deletions rtt_tf/include/rtt_tf/tf_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ namespace rtt_tf {
lookupTransformAtTime("lookupTransformAtTime"),
broadcastTransform("broadcastTransform"),
broadcastTransforms("broadcastTransforms"),
canTransform("canTransform")
broadcastStaticTransform("broadcastStaticTransform"),
broadcastStaticTransforms("broadcastStaticTransforms"),
canTransform("canTransform"),
canTransformAtTime("canTransformAtTime")
{
owner->requires("tf")->addOperationCaller(lookupTransform);
owner->requires("tf")->addOperationCaller(lookupTransformAtTime);
owner->requires("tf")->addOperationCaller(broadcastTransform);
owner->requires("tf")->addOperationCaller(broadcastTransforms);
owner->requires("tf")->addOperationCaller(broadcastStaticTransform);
owner->requires("tf")->addOperationCaller(broadcastStaticTransforms);
owner->requires("tf")->addOperationCaller(canTransform);
owner->requires("tf")->addOperationCaller(canTransformAtTime);
}

//! Check if the operations are ready
Expand All @@ -34,14 +40,20 @@ namespace rtt_tf {
lookupTransformAtTime.ready() &&
broadcastTransform.ready() &&
broadcastTransforms.ready() &&
canTransform.ready();
broadcastStaticTransform.ready() &&
broadcastStaticTransforms.ready() &&
canTransform.ready() &&
canTransformAtTime.ready();
}

RTT::OperationCaller<geometry_msgs::TransformStamped(const std::string&, const std::string&)> lookupTransform;
RTT::OperationCaller<geometry_msgs::TransformStamped(const std::string&, const std::string&, const ros::Time&)> lookupTransformAtTime;
RTT::OperationCaller<void(const geometry_msgs::TransformStamped&)> broadcastTransform;
RTT::OperationCaller<void(const std::vector<geometry_msgs::TransformStamped>&)> broadcastTransforms;
RTT::OperationCaller<void(const geometry_msgs::TransformStamped&)> broadcastStaticTransform;
RTT::OperationCaller<void(const std::vector<geometry_msgs::TransformStamped>&)> broadcastStaticTransforms;
RTT::OperationCaller<bool(const std::string&, const std::string&)> canTransform;
RTT::OperationCaller<bool(const std::string&, const std::string&, const ros::Time&)> canTransformAtTime;
};
}

Expand Down
5 changes: 5 additions & 0 deletions rtt_tf/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@

<build_depend>rtt</build_depend>
<build_depend>tf</build_depend>
<build_depend>tf2</build_depend>
<build_depend>rtt_roscomm</build_depend>
<build_depend>rtt_geometry_msgs</build_depend>
<build_depend>rtt_tf2_msgs</build_depend>

<run_depend>rtt</run_depend>
<run_depend>tf</run_depend>
<run_depend>tf2</run_depend>
<run_depend>rtt_roscomm</run_depend>
<run_depend>rtt_geometry_msgs</run_depend>
<run_depend>rtt_tf2_msgs</run_depend>

<export>
<rtt_ros>
<plugin_depend>rtt_tf2_msgs</plugin_depend>
<plugin_depend>rtt_roscomm</plugin_depend>
<plugin_depend>rtt_geometry_msgs</plugin_depend>
</rtt_ros>
Expand Down
Loading