Skip to content

Commit

Permalink
Removing initial slash from frame_id names for tf
Browse files Browse the repository at this point in the history
Following ROS specs towards tf2, tf_prefix it's
not supported in tf2.
This change allows packages like robot_localization
to work with ros-bridge, before that there where
a conflict between the frame_id names. Where
ros-bridge use "/map" and robot_localization
use "map".
Source: http://wiki.ros.org/tf2/Migration
  • Loading branch information
huberemanuel committed May 12, 2019
1 parent e7869b7 commit fd6e280
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions carla_ros_bridge/src/carla_ros_bridge/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, carla_world, params):
"""
self.params = params
super(CarlaRosBridge, self).__init__(
carla_id=0, carla_world=carla_world, frame_id='/map')
carla_id=0, carla_world=carla_world, frame_id='map')

self.timestamp_last_run = 0.0
self.ros_timestamp = rospy.Time()
Expand All @@ -68,7 +68,7 @@ def __init__(self, carla_world, params):
'/carla/objects', ObjectArray, queue_size=10)
self.object_array = ObjectArray()

self.map = Map(carla_world=self.carla_world, parent=self, topic='/map')
self.map = Map(carla_world=self.carla_world, parent=self, topic='map')

def destroy(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion carla_ros_bridge/src/carla_ros_bridge/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def get_tf_msg(self):
"""
tf_msg = TransformStamped()
tf_msg.header = self.get_msg_header()
tf_msg.header.frame_id = "/map"
tf_msg.header.frame_id = "map"
tf_msg.child_frame_id = self.get_frame_id()
tf_msg.transform = self.get_current_ros_transfrom()
return tf_msg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def publish_waypoints(self):
Publish the ROS message containing the waypoints
"""
msg = Path()
msg.header.frame_id = "/map"
msg.header.frame_id = "map"
msg.header.stamp = rospy.Time.now()
if self.current_route is not None:
for wp in self.current_route:
Expand Down

0 comments on commit fd6e280

Please sign in to comment.