ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

tf::TransformListener for Arduino

asked 2022-10-24 05:12:05 -0600

Edvard gravatar image

updated 2022-10-25 04:45:03 -0600

ravijoshi gravatar image

Hi, Sorry for the mistakes, as English is not my native language. I have a code having the following lines:

tf::TransformListener listener;
tf::StampedTransform transform;
while (ros.ok())
{
  try
  {
    listener.lookupTransform("/map", "/base_link", ros::Time(0), transform);
  }
  catch (tf::TransformException ex)
  {
    ROS_ERROR("Transform problem -> %s", ex.what());
  }
}

I need to handle tf::TransformException without try and catch block because this part of code should be executed on Arduino. Appreciate any help.

edit retag flag offensive close merge delete

Comments

If your idea is to call TransformListener.lookupTransform() on the Arduino, that is a bad idea. The operation is too heavy for a rs-232 serial link and small cpu unless you have no other choice. Please edit your description and explain more clearly what you think the Arduino needs to do. Publishing sensor data does not require knowing any transforms for the ros system.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-10-26 08:49:32 -0600 )edit

Thank you for reply. I have a node that finds robot position, than subscribes to data from topic that contains data from sensors. That data is published by arduino. My thought was to make sure that arduino is started publish data in same time as node, that subscribes to that data is run so no data from sensors is missed.

Edvard gravatar image Edvard  ( 2022-10-27 01:09:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-27 07:05:24 -0600

Edvard gravatar image

updated 2022-10-27 07:06:30 -0600

In the end I solved this problem with modifying not the node that starts on arduino but subscription node that I run on pc. For those who are curious, as far as I could find, there are no way to handle exception without try catch block.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-10-24 05:12:05 -0600

Seen: 290 times

Last updated: Oct 27 '22