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

removed leading slash for tf frames to avoid problems with tf2 migration #818

Open
wants to merge 1 commit into
base: master
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
2 changes: 1 addition & 1 deletion doc/morse/user/middlewares/ros.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Similarly, you can set a custom ``frame_id`` and ``child_frame_id``:

.. code-block :: python

foo.add_stream('ros', frame_id = '/world', child_frame_id = '/footprint')
foo.add_stream('ros', frame_id = 'world', child_frame_id = 'footprint')
2 changes: 1 addition & 1 deletion src/morse/middleware/ros/imu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class ImuPublisher(ROSPublisher):
""" Publish the data of the IMU sensor (without covariance). """
ros_class = Imu
default_frame_id = '/imu'
default_frame_id = 'imu'

def default(self, ci='unused'):
imu = Imu()
Expand Down
2 changes: 1 addition & 1 deletion src/morse/middleware/ros/laserscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class LaserScanPublisher(ROSPublisher):
""" Publish the ``range_list`` of the laser scanner. """
ros_class = LaserScan
default_frame_id = '/base_laser_link'
default_frame_id = 'base_laser_link'

def default(self, ci='unused'):
laserscan = LaserScan()
Expand Down
4 changes: 2 additions & 2 deletions src/morse/middleware/ros/odometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class OdometryPublisher(ROSPublisherTF):
'/base_footprint' through TF.
"""
ros_class = Odometry
default_frame_id = '/odom'
default_frame_id = 'odom'

def initialize(self):
ROSPublisherTF.initialize(self)
# store the frame ids
self.child_frame_id = self.kwargs.get("child_frame_id", "/base_footprint")
self.child_frame_id = self.kwargs.get("child_frame_id", "base_footprint")

logger.info("Initialized the ROS odometry sensor with frame_id '%s' " +\
"and child_frame_id '%s'", self.frame_id, self.child_frame_id)
Expand Down
8 changes: 4 additions & 4 deletions src/morse/middleware/ros/pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PoseStampedPublisher(ROSPublisher):
as ROS geometry_msgs.PoseStamped message.
"""
ros_class = PoseStamped
default_frame_id = '/map'
default_frame_id = 'map'

def default(self, ci='unused'):
if 'valid' not in self.data or self.data['valid']:
Expand All @@ -79,7 +79,7 @@ def default(self, ci='unused'):
class PoseWithCovarianceStampedPublisher(ROSPublisher):
""" Publish the position and orientation of the robot including the covariance. """
ros_class = PoseWithCovarianceStamped
default_frame_id = '/map'
default_frame_id = 'map'

def default(self, ci='unused'):
if 'valid' not in self.data or self.data['valid']:
Expand All @@ -96,12 +96,12 @@ class TFPublisher(ROSPublisherTF):
``frame_id`` and ``child_frame_id`` args, default '/map' and
'/base_link' through TF.
"""
default_frame_id = '/map'
default_frame_id = 'map'

def initialize(self):
ROSPublisherTF.initialize(self)
# store the frame ids
self.child_frame_id = self.kwargs.get("child_frame_id", "/base_link")
self.child_frame_id = self.kwargs.get("child_frame_id", "base_link")

logger.info("Initialized the ROS TF publisher with frame_id '%s' " + \
"and child_frame_id '%s'", self.frame_id, self.child_frame_id)
Expand Down
4 changes: 2 additions & 2 deletions src/morse/middleware/ros/semantic_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SemanticCameraPublisher(ROSPublisherTF):

def initialize(self):
if not self.component_instance.relative:
self.default_frame_id = '/map'
self.default_frame_id = 'map'
ROSPublisherTF.initialize(self)

def default(self, ci='unused'):
Expand All @@ -36,7 +36,7 @@ class SemanticCameraPublisherLisp(ROSPublisherTF):

def initialize(self):
if not self.component_instance.relative:
self.default_frame_id = '/map'
self.default_frame_id = 'map'
ROSPublisherTF.initialize(self)

def default(self, ci='unused'):
Expand Down
2 changes: 1 addition & 1 deletion src/morse/middleware/ros/velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class TwistStampedPublisher(ROSPublisher):
""" Publish the twist of the robot. """
ros_class = TwistStamped
default_frame_id = '/base_link'
default_frame_id = 'base_link'

def default(self, ci='unused'):
twist = TwistStamped()
Expand Down
2 changes: 1 addition & 1 deletion testing/middlewares/ros/tf_static_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def setUpEnv(self):

def _callback(self, m, precision = 0.01):
t = m.transforms[0]
if t.child_frame_id != '/morsy_test_1/pose':
if t.child_frame_id != 'morsy_test_1/pose':
return

p = t.transform.translation
Expand Down