@@ -44,7 +44,7 @@ RobotPublisher<State>::RobotPublisher(
4444 const std::string& target_frame_id)
4545 : node_handle_(" ~" ),
4646 prefix_ (prefix),
47- target_frame_id_ (target_frame_id),
47+ connecting_frame_id (target_frame_id),
4848 robot_state_publisher_(
4949 std::make_shared<robot_state_pub::RobotStatePublisher>(
5050 urdf_kinematics->get_tree ())),
@@ -88,7 +88,7 @@ void RobotPublisher<State>::publish_joint_state(const State& state,
8888
8989template <typename State>
9090void RobotPublisher<State>::publish_tf(const State& state,
91- const ros::Time& time)
91+ const ros::Time& time)
9292{
9393 publish_id_transform (
9494 time, " /" + root_frame_id_, tf::resolve (prefix_, root_frame_id_));
@@ -99,7 +99,6 @@ template <typename State>
9999void RobotPublisher<State>::publish_tf(
100100 const State& state,
101101 const JointsObsrv& obsrv,
102- const std::string& obsrv_tf_prefix,
103102 const ros::Time& time)
104103{
105104 std::map<std::string, double > state_joint_map;
@@ -111,8 +110,6 @@ void RobotPublisher<State>::publish_tf(
111110 // linked at the specified target frame
112111 tf::StampedTransform root_transform = get_root_transform (state_joint_map,
113112 obsrv_joint_map,
114- obsrv_tf_prefix,
115- target_frame_id_,
116113 time);
117114
118115 static tf::TransformBroadcaster br;
@@ -151,27 +148,25 @@ template <typename State>
151148tf::StampedTransform RobotPublisher<State>::get_root_transform(
152149 const std::map<std::string, double >& state_joint_map,
153150 const std::map<std::string, double >& obsrv_joint_map,
154- const std::string& obsrv_tf_prefix,
155- const std::string& connecting_frame,
156151 const ros::Time& time)
157152{
158153 // Lookup transform from target to root of joint map 1
159154 transformer_.set_joints (state_joint_map);
160155 tf::StampedTransform transform_t_r;
161156 transformer_.lookup_transform (
162- target_frame_id_ , root_frame_id_, transform_t_r);
157+ connecting_frame_id , root_frame_id_, transform_t_r);
163158
164159 // Lookup transform from root to target of joint map 2
165160 transformer_.set_joints (obsrv_joint_map);
166161 tf::StampedTransform transform_r_t ;
167162 transformer_.lookup_transform (
168- root_frame_id_, target_frame_id_ , transform_r_t );
163+ root_frame_id_, connecting_frame_id , transform_r_t );
169164
170165 // Compose the two tf_transforms
171166 tf::StampedTransform transform_r_r (
172167 transform_r_t * transform_t_r,
173168 time,
174- tf::resolve (obsrv_tf_prefix , root_frame_id_),
169+ tf::resolve (" " , root_frame_id_),
175170 tf::resolve (prefix_, root_frame_id_));
176171
177172 return transform_r_r;
0 commit comments