(const std::string &planner_id, const std::string &group, const std::map<
std::string, std::string > &params, bool bReplace=false)
|  Set the planner parameters for given group and planner_id.  More...

void  |  [ setPlanningTime
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#af4631a849c750b4c1428242475c8988d)
(double seconds)
|  Specify the maximum amount of time to use when planning.  More...

void  |  [ setStartState
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#af633a8772b33720ec482490a592fafcc)
(const moveit_msgs::RobotState &start_state)
|  If a different start state should be considered instead of the current
state of the robot, this function sets that state.  More...

void  |  [ setStartState
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aafb855a64062163d794d6c91e88fea31)
(const robot_state::RobotState &start_state)
|  If a different start state should be considered instead of the current
state of the robot, this function sets that state.  More...

void  |  [ setStartStateToCurrentState
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a34e857711a8dca3e98635f4925abaf46)
()
|  Set the starting state for planning to be that reported by the robot's
joint state publication.  More...

void  |  [ setSupportSurfaceName
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a42ec25f3ac294283222cbf5fe33c8907)
(const std::string &name)
|  For pick/place operations, the name of the support surface is used to
specify the fact that attached objects are allowed to touch the support
surface.  More...

void  |  [ setWorkspace
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#afdaac6aadb9aec749368dadcb0fc9fe3)
(double minx, double miny, double minz, double maxx, double maxy, double maxz)
|  Specify the workspace bounding box. The box is specified in the planning
frame (i.e. relative to the robot root link start position). This is useful
when the planning group contains the root joint of the robot – i.e. when


108  const  [ ros::NodeHandle
](../../../api/roscpp/html/structros_1_1NodeHandle_1_1no__validate.html) &
node_handle = [ ros::NodeHandle
](../../../api/roscpp/html/structros_1_1NodeHandle_1_1no__validate.html) ())


[ MOVEIT_STRUCT_FORWARD
](../../../api/moveit_core/html/namespacecollision__detection.html#a1cb8da8467ea8e22af94de00c401e975)


void MoveGroupInterface::clearTrajectoryConstraints()
{
  impl_->clearTrajectoryConstraints();
}
void MoveGroupInterface::setConstraintsDatabase(const std::string& host, unsigned int port)
{
  impl_->initializeConstraintsStorage(host, port);
}
void MoveGroupInterface::setWorkspace(double minx, double miny, double minz, double maxx, double maxy, double maxz)
{
  impl_->setWorkspace(minx, miny, minz, maxx, maxy, maxz);
}
/** \brief Set time allowed to planner to solve problem before aborting */
void MoveGroupInterface::setPlanningTime(double seconds)
{
  impl_->setPlanningTime(seconds);
}
/** \brief Get time allowed to planner to solve problem before aborting */
double MoveGroupInterface::getPlanningTime() const
{
  return impl_->getPlanningTime();
}
void MoveGroupInterface::setSupportSurfaceName(const std::string& name)
{
  impl_->setSupportSurfaceName(name);
}
const std::string& MoveGroupInterface::getPlanningFrame() const
{
  return impl_->getRobotModel()->getModelFrame();
}
const std::vector<std::string>& MoveGroupInterface::getJointModelGroupNames() const
{
  return impl_->getRobotModel()->getJointModelGroupNames();
}
bool MoveGroupInterface::attachObject(const std::string& object, const std::string& link)
{
  return attachObject(object, link, std::vector<std::string>());
}
bool MoveGroupInterface::attachObject(const std::string& object, const std::string& link,
                                      const std::vector<std::string>& touch_links)


};
// Function to support both Rolling and Humble on the main branch
// Rolling has deprecated the version of the create_client method that takes
// rmw_qos_profile_services_default for the QoS argument
#if RCLCPP_VERSION_GTE(17, 0, 0)  // Rolling
auto qosDefault()
{
  return rclcpp::SystemDefaultsQoS();
}
#else  // Humble
auto qosDefault()
{
  return rmw_qos_profile_services_default;
}
#endif
}  // namespace
class MoveGroupInterface::MoveGroupInterfaceImpl
{
  friend MoveGroupInterface;
public:
  MoveGroupInterfaceImpl(const rclcpp::Node::SharedPtr& node, const Options& opt,
                         const std::shared_ptr<tf2_ros::Buffer>& tf_buffer, const rclcpp::Duration& wait_for_servers)
    : opt_(opt), node_(node), logger_(moveit::getLogger("move_group_interface")), tf_buffer_(tf_buffer)
  {
    // We have no control on how the passed node is getting executed. To make sure MGI is functional, we're creating
    // our own callback group which is managed in a separate callback thread
    callback_group_ = node_->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive,
                                                   false /* don't spin with node executor */);
    callback_executor_.add_callback_group(callback_group_, node->get_node_base_interface());
    callback_thread_ = std::thread([this]() { callback_executor_.spin(); });
    robot_model_ = opt.robot_model ? opt.robot_model : getSharedRobotModel(node_, opt.robot_description);
    if (!getRobotModel())
    {
      std::string error = "Unable to construct robot model. Please make sure all needed information is on the "
                          "parameter server.";
      RCLCPP_FATAL_STREAM(logger_, error);
      throw std::runtime_error(error);
    }
    if (!getRobotModel()->hasJointModelGroup(opt.group_name))
    {


void
moveit::planning_interface::MoveGroupInterface::setMaxAccelerationScalingFactor
|  (  |  double  |  _max_acceleration_scaling_factor_ |  )  |
---|---|---|---|---|---

Set a scaling factor for optionally reducing the maximum joint acceleration.
Allowed values are in (0,1]. The maximum joint acceleration specified in the
robot model is multiplied by the factor. If outside valid range (imporantly,
this includes it being set to 0.0), the factor is set to a default value of
1.0 internally (i.e. maximum joint acceleration)


bool moveit::planning_interface::MoveGroupInterface::setRPYTarget  |  (  |
double  |  _roll_ ,
---|---|---|---
|  |  double  |  _pitch_ ,
|  |  double  |  _yaw_ ,
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the goal orientation of the end-effector _end_effector_link_ to be (
_roll_ , _pitch_ , _yaw_ ) radians.


Version:  Moveit 2 - Humble  Moveit 2 - Rolling  MoveIt 1 - Noetic  MoveIt 1 -
Melodic


inline void transformPose(const tf2_ros::Buffer& tf_buffer, const std::string& desired_frame,
                          geometry_msgs::msg::PoseStamped& target)
{
  if (desired_frame != target.header.frame_id)
  {
    geometry_msgs::msg::PoseStamped target_in(target);
    tf_buffer.transform(target_in, target, desired_frame);
    // we leave the stamp to ros::Time(0) on purpose
    target.header.stamp = rclcpp::Time(0);
  }
}
}  // namespace
bool MoveGroupInterface::setPositionTarget(double x, double y, double z, const std::string& end_effector_link)
{
  geometry_msgs::msg::PoseStamped target;
  if (impl_->hasPoseTarget(end_effector_link))
  {
    target = getPoseTarget(end_effector_link);
    transformPose(*impl_->getTF(), impl_->getPoseReferenceFrame(), target);
  }
  else
  {
    target.pose.orientation.x = 0.0;
    target.pose.orientation.y = 0.0;
    target.pose.orientation.z = 0.0;
    target.pose.orientation.w = 1.0;
    target.header.frame_id = impl_->getPoseReferenceFrame();
  }
  target.pose.position.x = x;
  target.pose.position.y = y;
  target.pose.position.z = z;
  bool result = setPoseTarget(target, end_effector_link);
  impl_->setTargetType(POSITION);
  return result;
}
bool MoveGroupInterface::setRPYTarget(double r, double p, double y, const std::string& end_effector_link)
{
  geometry_msgs::msg::PoseStamped target;
  if (impl_->hasPoseTarget(end_effector_link))
  {


    delete impl_;
    impl_ = other.impl_;
    logger_ = other.logger_;
    remembered_joint_values_ = std::move(other.remembered_joint_values_);
    other.impl_ = nullptr;
  }
  return *this;
}
const std::string& MoveGroupInterface::getName() const
{
  return impl_->getOptions().group_name;
}
const std::vector<std::string>& MoveGroupInterface::getNamedTargets() const
{
  // The pointer returned by getJointModelGroup is guaranteed by the class
  // constructor to always be non-null
  return impl_->getJointModelGroup()->getDefaultStateNames();
}
moveit::core::RobotModelConstPtr MoveGroupInterface::getRobotModel() const
{
  return impl_->getRobotModel();
}
bool MoveGroupInterface::getInterfaceDescription(moveit_msgs::msg::PlannerInterfaceDescription& desc) const
{
  return impl_->getInterfaceDescription(desc);
}
bool MoveGroupInterface::getInterfaceDescriptions(std::vector<moveit_msgs::msg::PlannerInterfaceDescription>& desc) const
{
  return impl_->getInterfaceDescriptions(desc);
}
std::map<std::string, std::string> MoveGroupInterface::getPlannerParams(const std::string& planner_id,
                                                                        const std::string& group) const
{
  return impl_->getPlannerParams(planner_id, group);
}
void MoveGroupInterface::setPlannerParams(const std::string& planner_id, const std::string& group,
                                          const std::map<std::string, std::string>& params, bool replace)
{
  impl_->setPlannerParams(planner_id, group, params, replace);
}


  * [ Robot Model and Robot State ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html)
    * [ The RobotModel and RobotState Classes ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#the-robotmodel-and-robotstate-classes)
    * [ Getting Started ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#getting-started)
    * [ Running the Code ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#running-the-code)
    * [ Expected Output ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#expected-output)
    * [ The Entire Code ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#the-entire-code)
      * [ Start ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#start)
      * [ Get Joint Values ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#get-joint-values)
      * [ Joint Limits ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#joint-limits)
      * [ Forward Kinematics ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#forward-kinematics)
      * [ Inverse Kinematics ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#inverse-kinematics)
      * [ Get the Jacobian ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#get-the-jacobian)
      * [ The Launch File ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#the-launch-file)
    * [ Debugging the Robot State ](../robot_model_and_robot_state/robot_model_and_robot_state_tutorial.html#debugging-the-robot-state)
  * [ Planning Scene ](../planning_scene/planning_scene_tutorial.html)
    * [ Getting Started ](../planning_scene/planning_scene_tutorial.html#getting-started)
    * [ The entire code ](../planning_scene/planning_scene_tutorial.html#the-entire-code)
      * [ Setup ](../planning_scene/planning_scene_tutorial.html#setup)
      * [ Collision Checking ](../planning_scene/planning_scene_tutorial.html#collision-checking)
        * [ Self-collision checking ](../planning_scene/planning_scene_tutorial.html#self-collision-checking)
        * [ Change the state ](../planning_scene/planning_scene_tutorial.html#change-the-state)
        * [ Checking for a group ](../planning_scene/planning_scene_tutorial.html#checking-for-a-group)
        * [ Getting Contact Information ](../planning_scene/planning_scene_tutorial.html#getting-contact-information)
        * [ Modifying the Allowed Collision Matrix ](../planning_scene/planning_scene_tutorial.html#modifying-the-allowed-collision-matrix)
        * [ Full Collision Checking ](../planning_scene/planning_scene_tutorial.html#full-collision-checking)
      * [ Constraint Checking ](../planning_scene/planning_scene_tutorial.html#constraint-checking)
        * [ Checking Kinematic Constraints ](../planning_scene/planning_scene_tutorial.html#checking-kinematic-constraints)
        * [ User-defined constraints ](../planning_scene/planning_scene_tutorial.html#user-defined-constraints)
    * [ The launch file ](../planning_scene/planning_scene_tutorial.html#the-launch-file)
    * [ Running the code ](../planning_scene/planning_scene_tutorial.html#running-the-code)
    * [ Expected Output ](../planning_scene/planning_scene_tutorial.html#expected-output)
  * [ Planning Scene Monitor ](../planning_scene_monitor/planning_scene_monitor_tutorial.html)
    * [ RobotState ](../planning_scene_monitor/planning_scene_monitor_tutorial.html#robotstate)
    * [ CurrentStateMonitor ](../planning_scene_monitor/planning_scene_monitor_tutorial.html#currentstatemonitor)
    * [ PlanningScene ](../planning_scene_monitor/planning_scene_monitor_tutorial.html#planningscene)
    * [ PlanningSceneMonitor ](../planning_scene_monitor/planning_scene_monitor_tutorial.html#planningscenemonitor)
    * [ PlanningSceneInterface ](../planning_scene_monitor/planning_scene_monitor_tutorial.html#planningsceneinterface)
  * [ Planning Scene ROS API ](../planning_scene_ros_api/planning_scene_ros_api_tutorial.html)
    * [ Getting Started ](../planning_scene_ros_api/planning_scene_ros_api_tutorial.html#getting-started)
    * [ Running the code ](../planning_scene_ros_api/planning_scene_ros_api_tutorial.html#running-the-code)


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::asyncExecute  |  (  |  const [
Plan ](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html)
& |  _plan_ |  )  |
---|---|---|---|---|---

Given a _plan_ , execute it without waiting for completion. Return true on
success.


898  void  setConstraintsDatabase(  const  std::string& host,  unsigned  int
port);


double moveit::planning_interface::MoveGroupInterface::getGoalJointTolerance
|  (  |  |  )  |  const
---|---|---|---|---

Get the tolerance that is used for reaching a joint goal. This is distance for
each joint in configuration space.


##  Member Data Documentation


649  const  geometry_msgs::PoseStamped& getPoseTarget(  const  std::string&
end_effector_link =  ""  )  const  ;


Definition at line [ 1514 ](move__group__interface_8cpp_source.html#l01514) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


  * [ Edit on GitHub ](https://github.com/ros-planning/moveit_tutorials/blob/master/doc/move_group_interface/move_group_interface_tutorial.rst)
  * [ MoveIt ](http://moveit.ros.org) »
  * [ Tutorials ](../../index.html) »
  * Move Group C++ Interface


ROS_INFO_NAMED("tutorial", "End effector link: %s", move_group_interface.getEndEffectorLink().c_str());


[ moveit::planning_interface::MoveGroupInterface::remembered_joint_values_
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a1dbc2672b6abc380e425b06e1d282c88)


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const std::vector< double > & |  _group_variable_values_ |  )  |
---|---|---|---|---|---

Set the JointValueTarget and use it for future planning requests.


|  [ MoveGroupInterfaceImpl
](classmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1MoveGroupInterfaceImpl.html)
* moveit::planning_interface::MoveGroupInterface::impl_
---
private

Definition at line [ 930 ](move__group__interface_8h_source.html#l00930) of
file [ move_group_interface.h ](move__group__interface_8h_source.html) .


**Definition:** [ move_group_interface.h:73
](move__group__interface_8h_source.html#l00073)


Returns


    {
      RCLCPP_ERROR_STREAM(logger_, "joint variable " << pair.first << " is not part of group "
                                                     << impl_->getJointModelGroup()->getName());
      return false;
    }
  }
  impl_->setTargetType(JOINT);
  impl_->getTargetRobotState().setVariablePositions(variable_values);
  return impl_->getTargetRobotState().satisfiesBounds(impl_->getGoalJointTolerance());
}
bool MoveGroupInterface::setJointValueTarget(const std::vector<std::string>& variable_names,
                                             const std::vector<double>& variable_values)
{
  if (variable_names.size() != variable_values.size())
  {
    RCLCPP_ERROR_STREAM(logger_, "sizes of name and position arrays do not match");
    return false;
  }
  const auto& allowed = impl_->getJointModelGroup()->getVariableNames();
  for (const auto& variable_name : variable_names)
  {
    if (std::find(allowed.begin(), allowed.end(), variable_name) == allowed.end())
    {
      RCLCPP_ERROR_STREAM(logger_, "joint variable " << variable_name << " is not part of group "
                                                     << impl_->getJointModelGroup()->getName());
      return false;
    }
  }
  impl_->setTargetType(JOINT);
  impl_->getTargetRobotState().setVariablePositions(variable_names, variable_values);
  return impl_->getTargetRobotState().satisfiesBounds(impl_->getGoalJointTolerance());
}
bool MoveGroupInterface::setJointValueTarget(const moveit::core::RobotState& rstate)
{
  impl_->setTargetType(JOINT);
  impl_->getTargetRobotState() = rstate;
  return impl_->getTargetRobotState().satisfiesBounds(impl_->getGoalJointTolerance());
}
bool MoveGroupInterface::setJointValueTarget(const std::string& joint_name, double value)
{


The group to construct the class instance for.


  * [ move_group_interface.h ](move__group__interface_8h_source.html)
  * [ move_group_interface.cpp ](move__group__interface_8cpp_source.html)


Now, we call the planner to compute the plan and visualize it. Note that we
are just planning, not asking move_group_interface to actually move the robot.


    ROS_INFO_NAMED("tutorial", "Detach the object from the robot");
    move_group_interface.detachObject(object_to_attach.id);


                                                const moveit_msgs::msg::Constraints& path_constraints,
                                                bool avoid_collisions, moveit_msgs::msg::MoveItErrorCodes* error_code)
{
  if (error_code)
  {
    return impl_->computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory, path_constraints,
                                       avoid_collisions, *error_code);
  }
  else
  {
    moveit_msgs::msg::MoveItErrorCodes err_tmp;
    err_tmp.val = moveit_msgs::msg::MoveItErrorCodes::SUCCESS;
    moveit_msgs::msg::MoveItErrorCodes& err = error_code ? *error_code : err_tmp;
    return impl_->computeCartesianPath(waypoints, eef_step, jump_threshold, trajectory, path_constraints,
                                       avoid_collisions, err);
  }
}
void MoveGroupInterface::stop()
{
  impl_->stop();
}
void MoveGroupInterface::setStartState(const moveit_msgs::msg::RobotState& start_state)
{
  moveit::core::RobotStatePtr rs;
  if (start_state.is_diff)
  {
    impl_->getCurrentState(rs);
  }
  else
  {
    rs = std::make_shared<moveit::core::RobotState>(getRobotModel());
    rs->setToDefaultValues();  // initialize robot state values for conversion
  }
  moveit::core::robotStateMsgToRobotState(start_state, *rs);
  setStartState(*rs);
}
void MoveGroupInterface::setStartState(const moveit::core::RobotState& start_state)
{
  impl_->setStartState(start_state);
}


[ moveit::planning_interface::MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html)


    ROS_INFO_NAMED("tutorial", "Attach the object to the robot");
    move_group_interface.attachObject(object_to_attach.id, "panda_hand", { "panda_leftfinger", "panda_rightfinger" });

    visual_tools.publishText(text_pose, "Object attached to robot", rvt::WHITE, rvt::XLARGE);
    visual_tools.trigger();

    /* Wait for MoveGroup to receive and process the attached collision object message */
    visual_tools.prompt("Press 'next' in the RvizVisualToolsGui window once the new object is attached to the robot");


Public Attributes  | [ List of all members
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan-
members.html)


void moveit::planning_interface::MoveGroupInterface::setGoalJointTolerance  |
(  |  double  |  _tolerance_ |  )  |
---|---|---|---|---|---

Set the joint tolerance (for each joint) that is used for reaching the goal
when moving to a joint value target.


469  const  std::string& end_effector_link =  ""  );


void moveit::planning_interface::MoveGroupInterface::setRandomTarget  |  (  |
|  )  |
---|---|---|---|---

Set the joint state goal to a random joint configuration.


We will reuse the old goal that we had and plan to it. Note that this will
only work if the current state already satisfies the path constraints. So we
need to set the start state to a new pose.


Definition at line [ 134 ](move__group__interface_8h_source.html#l00134) of
file [ move_group_interface.h ](move__group__interface_8h_source.html) .


Definition at line [ 2253 ](move__group__interface_8cpp_source.html#l02253) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


moveit::planning_interface::MoveGroupInterface::MoveGroupInterface  |  (  |
const std::string & |  _group_ ,
---|---|---|---
|  |  const [ boost::shared_ptr
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) < [
tf::Transformer ](../../../api/tf/html/c++/classtf_1_1Transformer.html) > & |
_tf_ ,
|  |  const [ ros::Duration
](../../../api/rostime/html/classros_1_1Duration.html) & |  _wait_for_servers_
|  )  |  |

Definition at line [ 1376 ](move__group__interface_8cpp_source.html#l01376) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::place  |  (  |  const
std::string & |  _object_ ,
---|---|---|---
|  |  const geometry_msgs::PoseStamped & |  _pose_ ,
|  |  bool  |  _plan_only_ = ` false `
|  )  |  |

Place an object at one of the specified possible location.


    * [ MoveIt IKFast ](../ikfast/ikfast_tutorial.html#moveit-ikfast)
    * [ Getting Started ](../ikfast/ikfast_tutorial.html#getting-started)
    * [ Creating the IKFast MoveIt plugin ](../ikfast/ikfast_tutorial.html#creating-the-ikfast-moveit-plugin)
      * [ Select IK Type ](../ikfast/ikfast_tutorial.html#select-ik-type)
      * [ Choose Planning Group ](../ikfast/ikfast_tutorial.html#choose-planning-group)
      * [ Generate IKFast MoveIt plugin ](../ikfast/ikfast_tutorial.html#generate-ikfast-moveit-plugin)
    * [ Usage ](../ikfast/ikfast_tutorial.html#usage)
      * [ Test the Plugin ](../ikfast/ikfast_tutorial.html#test-the-plugin)
    * [ Updating the Plugin ](../ikfast/ikfast_tutorial.html#updating-the-plugin)
    * [ Tweaking the creation process ](../ikfast/ikfast_tutorial.html#tweaking-the-creation-process)
  * [ TRAC-IK Kinematics Solver ](../trac_ik/trac_ik_tutorial.html)
    * [ Install ](../trac_ik/trac_ik_tutorial.html#install)
    * [ Usage ](../trac_ik/trac_ik_tutorial.html#usage)
  * [ OPW Kinematics Solver for Industrial Manipulators ](../opw_kinematics/opw_kinematics_tutorial.html)
    * [ Intro ](../opw_kinematics/opw_kinematics_tutorial.html#intro)
    * [ Purpose ](../opw_kinematics/opw_kinematics_tutorial.html#purpose)
    * [ Installation ](../opw_kinematics/opw_kinematics_tutorial.html#installation)
    * [ Usage ](../opw_kinematics/opw_kinematics_tutorial.html#usage)
    * [ Sharing OPW descriptions ](../opw_kinematics/opw_kinematics_tutorial.html#sharing-opw-descriptions)
  * [ Multiple Robot Arms ](../multiple_robot_arms/multiple_robot_arms_tutorial.html)
    * [ Introduction ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#introduction)
    * [ Getting Started ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#getting-started)
    * [ Step 1: Build the Xacro/URDF model of the multiple arms ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#step-1-build-the-xacro-urdf-model-of-the-multiple-arms)
    * [ Step 2: Prepare the MoveIt config package using MoveIt Setup Assistant ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#step-2-prepare-the-moveit-config-package-using-moveit-setup-assistant)
    * [ Step 3: Write the ROS controllers configuration and launch files for the multiple arms ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#step-3-write-the-ros-controllers-configuration-and-launch-files-for-the-multiple-arms)
    * [ Step 4: Integrate the simulation in Gazebo with MoveIt motion planning ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#step-4-integrate-the-simulation-in-gazebo-with-moveit-motion-planning)
    * [ Step 5: Plan arms motions with MoveIt Move Group Interface. ](../multiple_robot_arms/multiple_robot_arms_tutorial.html#step-5-plan-arms-motions-with-moveit-move-group-interface)


std::vector< std::string >
moveit::planning_interface::MoveGroupInterface::getKnownConstraints  |  (  |
|  )  |  const
---|---|---|---|---

Get the names of the known constraints as read from the Mongo database, if a
connection was achieved.


Definition at line [ 1704 ](move__group__interface_8cpp_source.html#l01704) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


        // transform the pose into the model frame, then do IK
        bool frame_found;
        const Eigen::Isometry3d& t = getTargetRobotState().getFrameTransform(frame, &frame_found);
        if (frame_found)
        {
          Eigen::Isometry3d p;
          tf2::fromMsg(eef_pose, p);
          return getTargetRobotState().setFromIK(getJointModelGroup(), t * p, eef, 0.0,
                                                 moveit::core::GroupStateValidityCallbackFn(), o);
        }
        else
        {
          RCLCPP_ERROR(logger_, "Unable to transform from frame '%s' to frame '%s'", frame.c_str(),
                       getRobotModel()->getModelFrame().c_str());
          return false;
        }
      }
    }
    else
      return false;
  }
  void setEndEffectorLink(const std::string& end_effector)
  {
    end_effector_link_ = end_effector;
  }
  void clearPoseTarget(const std::string& end_effector_link)
  {
    pose_targets_.erase(end_effector_link);
  }
  void clearPoseTargets()
  {
    pose_targets_.clear();
  }
  const std::string& getEndEffectorLink() const
  {
    return end_effector_link_;
  }
  const std::string& getEndEffector() const
  {
    if (!end_effector_link_.empty())


468  bool  setApproximateJointValueTarget(  const  geometry_msgs::PoseStamped&
eef_pose,


const [ ros::NodeHandle
](../../../api/roscpp/html/classros_1_1NodeHandle.html) &
moveit::planning_interface::MoveGroupInterface::getNodeHandle  |  (  |  |  )
|  const
---|---|---|---|---

Get the ROS node handle of this instance operates on.


164  [ MOVEIT_DEPRECATED
](namespacemoveit_1_1planning__interface.html#a706399608538b81b2936e34817260537)
[ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) (  const
std::string& group,  const  [ boost::shared_ptr<tf::Transformer>
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) & [ tf
](../../../api/eigen_conversions/html/namespacetf.html) ,


[ ros::Duration ](../../../api/rostime/html/classros_1_1Duration.html)


  rclcpp::Client<moveit_msgs::srv::GetPlannerParams>::SharedPtr get_params_service_;
  rclcpp::Client<moveit_msgs::srv::SetPlannerParams>::SharedPtr set_params_service_;
  rclcpp::Client<moveit_msgs::srv::GetCartesianPath>::SharedPtr cartesian_path_service_;
  // rclcpp::Client<moveit_msgs::srv::GraspPlanning>::SharedPtr plan_grasps_service_;
  std::unique_ptr<moveit_warehouse::ConstraintsStorage> constraints_storage_;
  std::unique_ptr<std::thread> constraints_init_thread_;
  bool initializing_constraints_;
};
MoveGroupInterface::MoveGroupInterface(const rclcpp::Node::SharedPtr& node, const std::string& group_name,
                                       const std::shared_ptr<tf2_ros::Buffer>& tf_buffer,
                                       const rclcpp::Duration& wait_for_servers)
  : logger_(moveit::getLogger("move_group_interface"))
{
  if (!rclcpp::ok())
    throw std::runtime_error("ROS does not seem to be running");
  impl_ =
      new MoveGroupInterfaceImpl(node, Options(group_name), tf_buffer ? tf_buffer : getSharedTF(), wait_for_servers);
}
MoveGroupInterface::MoveGroupInterface(const rclcpp::Node::SharedPtr& node, const Options& opt,
                                       const std::shared_ptr<tf2_ros::Buffer>& tf_buffer,
                                       const rclcpp::Duration& wait_for_servers)
  : logger_(moveit::getLogger("move_group_interface"))
{
  impl_ = new MoveGroupInterfaceImpl(node, opt, tf_buffer ? tf_buffer : getSharedTF(), wait_for_servers);
}
MoveGroupInterface::~MoveGroupInterface()
{
  delete impl_;
}
MoveGroupInterface::MoveGroupInterface(MoveGroupInterface&& other) noexcept
  : remembered_joint_values_(std::move(other.remembered_joint_values_))
  , impl_(other.impl_)
  , logger_(std::move(other.logger_))
{
  other.impl_ = nullptr;
}
MoveGroupInterface& MoveGroupInterface::operator=(MoveGroupInterface&& other) noexcept
{
  if (this != &other)
  {


We can print the name of the reference frame for this robot.


Copy link


Skip to content


* [ kinetic ](/questions/scope:all/sort:activity-desc/tags:kinetic/page:1/)


now I am doing a source build~!


odometry works very well but the mapping part does not work well.


For


Include my email address so I can be contacted


[ __ ](/questions/) |


No branches or pull requests


    * [ All features ](/features)
    * [ Documentation  ](https://docs.github.com)
    * [ GitHub Skills  ](https://skills.github.com/)
    * [ Blog  ](https://github.blog)


##  Comments


    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)


Hello,
I am using rgbd_odometry node to find initial odometry , and this is published
as /odom .
also the rgbd_node publish /tf between "odom" and "base_link" frame.


Search


**[ matlabbe ](/matlabbe) ** commented  Feb 21, 2022


` localization_pose ` is ` map ` -> ` base_link ` in [ PoseWithCovariance
](http://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PoseWithCovariance.html)
topic type.

---

All reactions


#  Provide feedback


You can’t perform that action at this time.


None yet


This will remove rtabmap from /usr/local path. Remove afterwards rtabmap_ws
from your ` ROS_PACKAGE_PATH ` (just don't source `
/rtabmap_ws/devel/setup.bash ` ).


Copy link


Toggle navigation


and then it does not show me any errors.


[ Sign in
](/login?return_to=https%3A%2F%2Fgithub.com%2Fintrolab%2Frtabmap_ros%2Fissues%2F721)


[ Sign in
](/login?return_to=https%3A%2F%2Fgithub.com%2Fintrolab%2Frtabmap_ros%2Fissues%2F960)


[ kinetic ](https://discourse.ros.org/tag/kinetic)


**This is my command for rtabmap**


    <node pkg="tf" type="static_transform_publisher" name="map_to_odom"
          args="0.0 0.0 0.0 0 0 0.0 /map /odom 40" />
    <node pkg="tf" type="static_transform_publisher" name="odom_to_basefootprint"
          args="0.0 0.0 0.0 0 0 0.0 /odom /base_footprint 40" />
    <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link"
          args="0.0 0.0 0.0 0 0 0.0 /base_footprint /base_link 40" />
    <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser"
          args="0.2245 0.0 0.2 0.0 0.0 0.0 /base_link /laser_frame 40" />


* [ GitHub Sponsors  Fund open source developers  ](/sponsors)


[ tags ](/tags/) [ users ](/users/) [ badges ](/badges/)


No milestone


edited


Cancel  Submit feedback


[ Powered by Askbot version 0.10.2 ](http://askbot.com)


#  Provide feedback


Pick a username


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=80&v=4)
](/matlabbe)


        // Turtle only exists in 2D, thus we get x and y translation
        // coordinates from the message and set the z coordinate to 0
        t.transform.translation.x = msg->x;
        t.transform.translation.y = msg->y;
        t.transform.translation.z = 0.0;

        // For the same reason, turtle can only rotate around one axis
        // and this why we set rotation in x and y to 0 and obtain
        // rotation in z axis from the message
        tf2::Quaternion q;
        q.setRPY(0, 0, msg->theta);
        t.transform.rotation.x = q.x();
        t.transform.rotation.y = q.y();
        t.transform.rotation.z = q.z();
        t.transform.rotation.w = q.w();

        // Send the transformation
        tf_broadcaster_->sendTransform(t);
      }

      rclcpp::Subscription<turtlesim::msg::Pose>::SharedPtr subscription_;
      std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;
      std::string turtlename_;
    };

    int main(int argc, char * argv[])
    {
      rclcpp::init(argc, argv);
      rclcpp::spin(std::make_shared<FramePublisher>());
      rclcpp::shutdown();
      return 0;
    }


**[ kdhRGT ](/kdhRGT) ** commented  Feb 23, 2022  •


roslaunch rtabmap_ros rtabmap.launch launch_prefix:="xterm -e gdb -ex run --args" rviz:=true rtabmapviz:=false rgb_topic:=/camera/color/image_raw depth_registered_topic:=/camera/depth/image_raw camera_info_topic:=/camera/color/camera_info frame_id:=base_link rtabmap_args:="--delete_db_on_start" estimation:=1


[ https://answers.ros.org/question/2055...
](https://answers.ros.org/question/205500/tf-error-lookup-would-require-
extrapolation-into-the-past/)


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


Copy link


[ General  ](/c/general/8)


##  Use saved searches to filter your results more quickly


I also instated a binary program.


* [ Pricing ](/pricing)


#  How to get the current odometry correction tf (map -> odom)  #960


Search or jump to...


**Here, I attached what I had errors from gdb.**


The error is:


Milestone


First time here? Check out the FAQ!


Email Address


[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-
name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-
repo&source_repo=introlab%2Frtabmap_ros)


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=52&v=4)
](/matlabbe) [
![@shrinivas96](https://avatars.githubusercontent.com/u/19876821?s=52&v=4)
](/shrinivas96) [ ![@hatem-
darweesh](https://avatars.githubusercontent.com/u/20182801?s=52&v=4) ](/hatem-
darweesh) [
![@farishajdarpasic](https://avatars.githubusercontent.com/u/83273784?s=52&v=4)
](/farishajdarpasic)


best regards

---

The text was updated successfully, but these errors were encountered:


But when I visualize the tf_tree there is no "map" frame. only the "odom" ->
"base_link".


Has anyone done this before? Or is there a simpler solution which doesn't
include changing hector_mapping package code?


edited


##  Comments


    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)


[ transform angular velocity between differents tf
](/question/300440/transform-angular-velocity-between-differents-tf/)


You signed in with another tab or window. [ Reload ]() to refresh your
session.  You signed out in another tab or window. [ Reload ]() to refresh
your session.  You switched accounts on another tab or window. [ Reload ]() to
refresh your session.  Dismiss alert


      * [ Contributing to ROS 2 Documentation ](../../../The-ROS2-Project/Contributing/Contributing-To-ROS-2-Documentation.html)
    * [ Features Status ](../../../The-ROS2-Project/Features.html)
    * [ Feature Ideas ](../../../The-ROS2-Project/Feature-Ideas.html)
    * [ Roadmap ](../../../The-ROS2-Project/Roadmap.html)
    * [ ROSCon Talks ](../../../The-ROS2-Project/ROSCon-Content.html)
    * [ Project Governance ](../../../The-ROS2-Project/Governance.html)
      * [ ROS 2 Technical Steering Committee Charter ](../../../The-ROS2-Project/Governance/ROS2-TSC-Charter.html)
      * [ ROS 2 TSC applicant intake process ](../../../The-ROS2-Project/Governance/ROS2-TSC-Intake-process.html)
      * [ About Working Groups ](../../../The-ROS2-Project/Governance/Working-Groups.html)
      * [ How to Start a Community Working Group ](../../../The-ROS2-Project/Governance/How-To-Start-A-Community-Working-Group.html)
    * [ Marketing ](../../../The-ROS2-Project/Marketing.html)
    * [ Metrics ](../../../The-ROS2-Project/Metrics.html)
  * [ API Documentation ](../../../API-Docs.html)
  * [ Related Projects ](../../../Related-Projects.html)
    * [ Intel ROS 2 Projects ](../../../Related-Projects/Intel-ROS2-Projects.html)
    * [ NVIDIA ROS 2 Projects ](../../../Related-Projects/Nvidia-ROS2-Projects.html)
  * [ Glossary ](../../../Glossary.html)
  * [ Citations ](../../../Citations.html)

__ [ ROS 2 Documentation: Humble ](../../../index.html)

  * [ ](../../../index.html)
  * [ Tutorials ](../../../Tutorials.html)
  * [ Intermediate ](../../Intermediate.html)
  * [ ` tf2  ` ](Tf2-Main.html)
  * Writing a broadcaster (C++)
  * [ Edit on GitHub ](https://github.com/ros2/ros2_documentation/blob/humble/source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst)

* * *

**You're reading the documentation for an older, but still supported, version
of ROS 2. For information on the latest version, please have a look at[ Iron
](../../../../iron/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-
Cpp.html) . **

#  Writing a broadcaster (C++)  ï

**Goal:** Learn how to broadcast the state of a robot to tf2.

**Tutorial level:** Intermediate


Sorry, something went wrong.


Topic  |  |  Replies  |  Views  |  Activity
---|---|---|---|---
[ Simplest remap / transform function ](https://discourse.ros.org/t/simplest-
remap-transform-function/9940)


All reactions


  Summary  ï

In this tutorial you learned how to broadcast the pose of the robot (position
and orientation of the turtle) to tf2 and how to use the ` tf2_echo  ` tool.
To actually use the transforms broadcasted to tf2, you should move on to the
next tutorial about creating a [ tf2 listener  ](Writing-A-Tf2-Listener-
Cpp.html) .

[ Previous ](Writing-A-Tf2-Broadcaster-Py.html "Writing a broadcaster
\(Python\)") [ Next  ](Writing-A-Tf2-Listener-Py.html "Writing a listener
\(Python\)")

* * *

© Copyright 2024, Open Robotics.

Built with [ Sphinx ](https://www.sphinx-doc.org/) using a [ theme
](https://github.com/readthedocs/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .

Other Versions  v: humble

Releases

     [ Iron (latest) ](../../../../iron/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.html)
     [ Humble ](Writing-A-Tf2-Broadcaster-Cpp.html)
     [ Galactic (EOL) ](../../../../galactic/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.html)
     [ Foxy (EOL) ](../../../../foxy/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.html)
     [ Eloquent (EOL) ](../../../../eloquent/index.html)
     [ Dashing (EOL) ](../../../../dashing/index.html)
     [ Crystal (EOL) ](../../../../crystal/index.html)

In Development

     [ Rolling ](../../../../rolling/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Broadcaster-Cpp.html)


But it shows an error when I play my rosbag file


|  0  |  847  |  May 19, 2019
[ [Request for Input] Potential Existing SLAM Toolbox Serialized File
Invalidation ](https://discourse.ros.org/t/request-for-input-potential-
existing-slam-toolbox-serialized-file-invalidation/19520)


I suggest to uninstall rtabmap built from source and use the binaries to make
sure rtabmap is linked to proper libraries. You can do in rtabmap/build:


    <arg name="frame_id"                default="base_link"/>
    <arg name="odom_frame_id"           default="camera_color_optical_frame"/>
    <arg name="odom_frame_id_init"      default=""/>


    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)


Other option is to lookup transform ` map->base_link ` when receiving `
rtabmap/info ` message (at time in that message).


I should remove all folders about devel, build before building the workspace.


**[ kdhRGT ](/kdhRGT) ** commented  Feb 21, 2022  •


[ @matlabbe ](https://github.com/matlabbe) Thanks for replying to me.


To fix:


[ introlab ](/introlab) /  **[ rtabmap_ros ](/introlab/rtabmap_ros) ** Public


##  Use saved searches to filter your results more quickly


    At time 1625137664.950813527
    - Translation: [3.750, 6.563, 0.000]
    - Rotation: in Quaternion [0.000, 0.000, 0.934, -0.357]
    At time 1625137665.906280726
    - Translation: [2.320, 5.282, 0.000]
    - Rotation: in Quaternion [0.000, 0.000, 0.934, -0.357]
    At time 1625137666.850775673
    - Translation: [2.153, 5.133, 0.000]
    - Rotation: in Quaternion [0.000, 0.000, -0.365, 0.931]

If you run ` tf2_echo  ` for the transform between the ` world  ` and `
turtle2  ` , you should not see a transform, because the second turtle is not
there yet. However, as soon as we add the second turtle in the next tutorial,
the pose of ` turtle2  ` will be broadcast to tf2.


Copy link


[ ROS Projects  ](/c/ros-projects/10)


Member


Assignees


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=80&v=4)
](/matlabbe)


To see all available qualifiers, see our [ documentation
](https://docs.github.com/search-github/github-code-search/understanding-
github-code-search-syntax) .


Thanks


but.. I don't know how can I connect map frame to odom.


Password


Already on GitHub? [ Sign in
](/login?return_to=%2Fintrolab%2Frtabmap_ros%2Fissues%2Fnew%2Fchoose) to your
account


**[ kdhRGT ](/kdhRGT) ** commented  Feb 20, 2022  •


    * [ Enterprise ](/enterprise)
    * [ Teams ](/team)
    * [ Startups ](/enterprise/startups)
    * [ Education  ](https://education.github.com)


[ Search syntax tips ](https://docs.github.com/search-github/github-code-
search/understanding-github-code-search-syntax)


**[ matlabbe ](/matlabbe) ** commented  Jun 17, 2023


[ ![Screenshot from 2022-02-23 16-03-03](https://user-
images.githubusercontent.com/99226572/155274288-1dc2f1bf-8426-4930-a2c0-436ac6584929.png)
](https://user-
images.githubusercontent.com/99226572/155274288-1dc2f1bf-8426-4930-a2c0-436ac6584929.png)


I also came across this wonderful page: [
http://wiki.ros.org/tf/Errors%20expla...
](http://wiki.ros.org/tf/Errors%20explained) and I think the problem is
similar to what is mentioned in second point under "6. Error:
ExtrapolationExceptions" So a potential solution is to add a tf::MessageFilter
in hector_mapping.


[ ros2 ](https://discourse.ros.org/tag/ros2)


I put the "enter" on gdb terminal of rtabmap to continue.


##  Question Tools


[ General  ](/c/general/8)


[ ![@kdhRGT](https://avatars.githubusercontent.com/u/99226572?s=80&v=4)
](/kdhRGT)


  * [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
  * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
  * [ Security ](/security)
  * [ Status ](https://www.githubstatus.com/)
  * [ Docs ](https://docs.github.com/)
  * [ Contact ](https://support.github.com?tags=dotcom-footer)
  * Manage cookies
  * Do not share my personal information


ROS Resources: [ Documentation ](http://wiki.ros.org/) | [ Support
](http://wiki.ros.org/Support) | [ Discussion Forum
](http://discourse.ros.org/) | [ Index ](http://index.ros.org/) | [ Service
Status ](http://status.ros.org/) | [ ros @ Robotics Stack Exchange
](https://robotics.stackexchange.com/questions/tagged/ros)
---

_Attention:_ Answers.ros.org is deprecated as of August the 11th, 2023. Please
visit [ robotics.stackexchange.com ](http://robotics.stackexchange.com) to ask
a new question. This site will remain online in read-only mode during the
transition and into the foreseeable future. Selected questions and answers
have been migrated, and redirects have been put in place to direct users to
the corresponding questions on Robotics Stack Exchange. Additional details are
[ available here ](https://discourse.ros.org/t/ros-and-gazebo-answers-
migration-to-robotics-stack-exchange-process/31494) .


Name


[ hector_slam with Sick TIM561 ](/question/284420/hector_slam-with-sick-
tim561/)


Clear


The time difference in error messages always differs by ~200ms. The error
appears randomly, and once it appears, no further mapping occurs. **But before
getting this error the mapping works perfectly.**


By clicking “Sign up for GitHub”, you agree to our [ terms of service
](https://docs.github.com/terms) and [ privacy statement
](https://docs.github.com/privacy) . We’ll occasionally send you account
related emails.


Query


* [ Pricing ](/pricing)


Friends, I'm facing an issue with hector_mapping. The mapping starts fine, but
after some time, I get the following error:


* Solutions


If you do "enter" on gdb terminal of rtabmap to continue? If it is crashed,
type "bt" in the gdb terminal to show the backtrace if so. Is rtabmap built
from source or binaries?

---

All reactions


For


##  Stats


[ ![cc-by-sa](/m/default/media/images/cc-by-sa.png?v=28)
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) ROS Answers is
licensed under Creative Commons Attribution 3.0 Content on this site is
licensed under a [ Creative Commons Attribution Share Alike 3.0
](http://creativecommons.org/licenses/by-sa/3.0/legalcode) license.


I can watch the odometry results in odom frame in rviz.


    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)


So if I want to extract corrected position of the robot, I could use one of
these two options:


I followed a similar solution for my system.


* [ The ReadME Project  GitHub community articles  ](/readme)


2 participants


Include my email address so I can be contacted


    . install/setup.bash

    . install/setup.bash

    # CMD
    call install\setup.bat

    # Powershell
    .\install\setup.ps1


[ about ](/about/) |  [ faq ](/faq/) |  [ help ](/help/ "help") |  [ privacy
policy ](/privacy/) |  [ terms of service ](/terms/)


[ ![parzival gravatar
image](//www.gravatar.com/avatar/8088536535cbaec0fcb48aa33bd1b3fc?s=32&d=identicon&r=PG)
](/users/35453/parzival/)


Hello,


  1. sudo gedit /opt/ros/kinetic/share/hector_mapping/launch/mapping_default.launch
  2. change default value of ` odom_frame ` from ` nav ` to ` odom `
  3. make sure you have static tf transforms from /map to /laser_frame; something like…


Assignees


Sorry, something went wrong.


#  Search code, repositories, users, issues, pull requests...


Resources


Thank you so much. But I don't know what was my problem,, maybe I installed
the binary programs.


Copy link


Author


[ ![@kdhRGT](https://avatars.githubusercontent.com/u/99226572?s=80&v=4)
](/kdhRGT)


##  Comments


**[ matlabbe ](/matlabbe) ** commented  Jul 13, 2023


[ indigo ](https://discourse.ros.org/tag/indigo) , [ release
](https://discourse.ros.org/tag/release) , [ kinetic
](https://discourse.ros.org/tag/kinetic) , [ lunar
](https://discourse.ros.org/tag/lunar) , [ melodic
](https://discourse.ros.org/tag/melodic)


4 participants


go to rtabmap/build folder


**frame id setting in launch file**


    #include "geometry_msgs/msg/transform_stamped.hpp"
    #include "rclcpp/rclcpp.hpp"
    #include "tf2/LinearMath/Quaternion.h"
    #include "tf2_ros/transform_broadcaster.h"
    #include "turtlesim/msg/pose.hpp"

    class FramePublisher : public rclcpp::Node
    {
    public:
      FramePublisher()
      : Node("turtle_tf2_frame_publisher")
      {
        // Declare and acquire `turtlename` parameter
        turtlename_ = this->declare_parameter<std::string>("turtlename", "turtle");

        // Initialize the transform broadcaster
        tf_broadcaster_ =
          std::make_unique<tf2_ros::TransformBroadcaster>(*this);

        // Subscribe to a turtle{1}{2}/pose topic and call handle_turtle_pose
        // callback function on each message
        std::ostringstream stream;
        stream << "/" << turtlename_.c_str() << "/pose";
        std::string topic_name = stream.str();

        subscription_ = this->create_subscription<turtlesim::msg::Pose>(
          topic_name, 10,
          std::bind(&FramePublisher::handle_turtle_pose, this, std::placeholders::_1));
      }

    private:
      void handle_turtle_pose(const std::shared_ptr<turtlesim::msg::Pose> msg)
      {
        geometry_msgs::msg::TransformStamped t;

        // Read message content and assign it to
        // corresponding tf variables
        t.header.stamp = this->get_clock()->now();
        t.header.frame_id = "world";
        t.child_frame_id = turtlename_.c_str();


[ ](https://github.com/)


[ ![Screenshot from 2022-02-20 18-52-56](https://user-
images.githubusercontent.com/99226572/154837272-f69330c1-afcd-48cc-84cc-b8e488096603.png)
](https://user-
images.githubusercontent.com/99226572/154837272-f69330c1-afcd-48cc-84cc-b8e488096603.png)


add a comment


* Open Source


#  How to get the current odometry correction tf (map -> odom)  #960


[ kdhRGT ](/kdhRGT) opened this issue  Feb 20, 2022  · 7 comments


[ ](https://github.com "GitHub") © 2024 GitHub, Inc.


By Solution


could not get transform from base_link to camera_color_optical_frame (stamp = ~~~) ~~~


I can run rtapmap by your help.


Toggle navigation


[ General  ](/c/general/8)


Sorry, something went wrong.


[ Sign up
](/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-
name%3E%2F%3Crepo-
name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-
repo&source_repo=introlab%2Frtabmap_ros)


One solution can be to use Matrix for conversion. I think this can also be
used with tf.
Can you suggest some good source to understand the tf.


Explore


Edit: I can see in [ this other post
](https://github.com/introlab/rtabmap_ros/issues/350#issuecomment-1259659987)
that "transform would change only on loop closures". So I guess this ` /odom `
is still the one being calculated by Gazebo, and some corrections based on
loop closures? (I say Gazebo because ` rqt_graph ` shows that gazebo publishes
the ` /odom ` topic.)

---

All reactions


and catkin_my_workspace


Projects


**Have a question about this project?** Sign up for a free GitHub account to
open an issue and contact its maintainers and the community.


**This is my tf free from rosbag**


Repositories


**[ hatem-darweesh ](/hatem-darweesh) ** commented  Apr 27, 2023


[ how align imu data with lidar data ](/question/363155/how-align-imu-data-
with-lidar-data/)


No one assigned


[ Saurabh_Bansal  ](https://discourse.ros.org/u/Saurabh_Bansal) December 19,
2017, 6:51pm  3


My workspace is built from source~!


**but map results don't show me anything.**


[ getCurrentPose take too long time ](/question/359342/getcurrentpose-take-
too-long-time/)


Member


No branches or pull requests


edit


  Prerequisites  ï

This tutorial assumes you have a working knowledge of ROS 2 and you have
completed the [ Introduction to tf2 tutorial  ](Introduction-To-Tf2.html) and
[ tf2 static broadcaster tutorial (C++)  ](Writing-A-Tf2-Static-Broadcaster-
Cpp.html) . Weâll be reusing the ` learning_tf2_cpp  ` package from that
last tutorial.

In previous tutorials, you learned how to [ create a workspace
](../../Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-
Workspace.html) and [ create a package  ](../../Beginner-Client-
Libraries/Creating-Your-First-ROS2-Package.html) .


Any help would be much appreciated. Thank you :)


[ @matlabbe ](https://github.com/matlabbe)


New issue


    * [ Topics ](/topics)
    * [ Trending ](/trending)
    * [ Collections ](/collections)


[ ![Screenshot from 2022-02-23 15-50-18](https://user-
images.githubusercontent.com/99226572/155273966-17ff7444-9779-49fb-b8f8-acb747b6641d.png)
](https://user-
images.githubusercontent.com/99226572/155273966-17ff7444-9779-49fb-b8f8-acb747b6641d.png)


##  Related questions


Copy link


Please note: ROS Answers requires javascript to work properly, please enable
javascript in your browser, [ here is how
](https://www.google.com/support/bin/answer.py?answer=23852)


The errors message was that


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=40&v=4)
](/matlabbe) [ matlabbe ](/matlabbe) closed this as [ completed
](/introlab/rtabmap_ros/issues?q=is%3Aissue+is%3Aclosed+archived%3Afalse+reason%3Acompleted)
Feb 25, 2022


Hector_mapping Transform fails after some time


[ frames.pdf
](https://github.com/introlab/rtabmap_ros/files/8103732/frames.pdf)
[ ![Screenshot from 2022-02-20 19-09-18](https://user-
images.githubusercontent.com/99226572/154837827-2b5b2d30-d2aa-4a15-acd8-957e74e6fee0.png)
](https://user-
images.githubusercontent.com/99226572/154837827-2b5b2d30-d2aa-4a15-acd8-957e74e6fee0.png)


|  8  |  2018  |  March 23, 2021
[ Autonomous navigation using navigation stack + hector_slam
](https://discourse.ros.org/t/autonomous-navigation-using-navigation-stack-
hector-slam/3246)


**[ matlabbe ](/matlabbe) ** commented  Feb 24, 2022  •


The site is read-only. Please transition to use Robotics Stack Exchange


I am trying to use tf in my code. My requirement is as below:


The image resolution is very low so I am not sure that you can see it
correctly or not


You can’t perform that action at this time.


1 Like


and it works!!!


and install rtabmap again.


Repositories


      * [ Ardent Apalone ( ` ardent  ` ) ](../../../Releases/Release-Ardent-Apalone.html)
      * [ Beta 3 ( ` r2b3  ` ) ](../../../Releases/Beta3-Overview.html)
      * [ Beta 2 ( ` r2b2  ` ) ](../../../Releases/Beta2-Overview.html)
      * [ Beta 1 ( ` Asphalt  ` ) ](../../../Releases/Beta1-Overview.html)
      * [ Alphas ](../../../Releases/Alpha-Overview.html)
    * [ Development process for a release ](../../../Releases/Release-Process.html)
  * [ Tutorials ](../../../Tutorials.html)
    * [ Beginner: CLI tools ](../../Beginner-CLI-Tools.html)
      * [ Configuring environment ](../../Beginner-CLI-Tools/Configuring-ROS2-Environment.html)
      * [ Using ` turtlesim  ` , ` ros2  ` , and ` rqt  ` ](../../Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-Turtlesim.html)
      * [ Understanding nodes ](../../Beginner-CLI-Tools/Understanding-ROS2-Nodes/Understanding-ROS2-Nodes.html)
      * [ Understanding topics ](../../Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.html)
      * [ Understanding services ](../../Beginner-CLI-Tools/Understanding-ROS2-Services/Understanding-ROS2-Services.html)
      * [ Understanding parameters ](../../Beginner-CLI-Tools/Understanding-ROS2-Parameters/Understanding-ROS2-Parameters.html)
      * [ Understanding actions ](../../Beginner-CLI-Tools/Understanding-ROS2-Actions/Understanding-ROS2-Actions.html)
      * [ Using ` rqt_console  ` to view logs ](../../Beginner-CLI-Tools/Using-Rqt-Console/Using-Rqt-Console.html)
      * [ Launching nodes ](../../Beginner-CLI-Tools/Launching-Multiple-Nodes/Launching-Multiple-Nodes.html)
      * [ Recording and playing back data ](../../Beginner-CLI-Tools/Recording-And-Playing-Back-Data/Recording-And-Playing-Back-Data.html)
    * [ Beginner: Client libraries ](../../Beginner-Client-Libraries.html)
      * [ Using ` colcon  ` to build packages ](../../Beginner-Client-Libraries/Colcon-Tutorial.html)
      * [ Creating a workspace ](../../Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html)
      * [ Creating a package ](../../Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html)
      * [ Writing a simple publisher and subscriber (C++) ](../../Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html)
      * [ Writing a simple publisher and subscriber (Python) ](../../Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.html)
      * [ Writing a simple service and client (C++) ](../../Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.html)
      * [ Writing a simple service and client (Python) ](../../Beginner-Client-Libraries/Writing-A-Simple-Py-Service-And-Client.html)
      * [ Creating custom msg and srv files ](../../Beginner-Client-Libraries/Custom-ROS2-Interfaces.html)
      * [ Implementing custom interfaces ](../../Beginner-Client-Libraries/Single-Package-Define-And-Use-Interface.html)
      * [ Using parameters in a class (C++) ](../../Beginner-Client-Libraries/Using-Parameters-In-A-Class-CPP.html)
      * [ Using parameters in a class (Python) ](../../Beginner-Client-Libraries/Using-Parameters-In-A-Class-Python.html)
      * [ Using ` ros2doctor  ` to identify issues ](../../Beginner-Client-Libraries/Getting-Started-With-Ros2doctor.html)
      * [ Creating and using plugins (C++) ](../../Beginner-Client-Libraries/Pluginlib.html)
    * [ Intermediate ](../../Intermediate.html)
      * [ Managing Dependencies with rosdep ](../Rosdep.html)
      * [ Creating an action ](../Creating-an-Action.html)
      * [ Writing an action server and client (C++) ](../Writing-an-Action-Server-Client/Cpp.html)
      * [ Writing an action server and client (Python) ](../Writing-an-Action-Server-Client/Py.html)
      * [ Writing a Composable Node (C++) ](../Writing-a-Composable-Node.html)
      * [ Composing multiple nodes in a single process ](../Composition.html)
      * [ Monitoring for parameter changes (C++) ](../Monitoring-For-Parameter-Changes-CPP.html)


The hector mapping package is not finding the TF even though I have created a
static reference TF. I keep getting the following error when I try to launch
the training.launch file located in ~/hector_slam/launch. I modified the
training.launch file in order to create my TF. The hector_slam package
partially works but it does not publish the map_odom transformation so I have
no way of knowing the relative location of my rover from the initial location.
Can you please help?


|  1  |  1938  |  November 27, 2017
[ Tf_transformations - ROS 2 Python package for easy TF math
](https://discourse.ros.org/t/tf-transformations-ros-2-python-package-for-
easy-tf-math/21077)


  1. Use transformations ` odom->base_link ` and ` map->odom ` and from that get ` map->base_link `
  2. Use data from ` /rtabmap/localization_pose ` topic when message is being published to this topic, and in between use data from ` /odom ` topic. Just for clarification, is this data from ` localization_pose ` like additional pose, or pose after fusing correction and prediction. What I mean is whether the ` localization_pose ` is like GPS or it is pose after fusing GPS and odometry?


cd ~/rtabmap_ros


  * An image sensor is mounted at a location with IR, that is providing xyz coordinates for my target
  * I need to convert those coordinates from Sensor frame of reference to my ARM frame of reference.


Copy link


edited


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=80&v=4)
](/matlabbe)


i solved the problem by this process.


[ subscribe to rss feed ](/feeds/question/360524/ "subscribe to the rss feed")


[ ros::init() running multiple threads? ](/question/283529/rosinit-running-
multiple-threads/)


|  1  |  3788  |  June 25, 2021

  * [ Home ](/)
  * [ Categories ](/categories)
  * [ FAQ/Guidelines ](/guidelines)
  * [ Terms of Service ](/tos)
  * [ Privacy Policy ](/privacy)


[ https://discourse.ros.org/t/hector-ma...
](https://discourse.ros.org/t/hector-mapping-results-in-tf-transformation-
error/3396)


Member


  * [ Code  ](/introlab/rtabmap_ros)
  * [ Issues  428  ](/introlab/rtabmap_ros/issues)
  * [ Pull requests  0  ](/introlab/rtabmap_ros/pulls)
  * [ Actions  ](/introlab/rtabmap_ros/actions)
  * [ Projects  0  ](/introlab/rtabmap_ros/projects)
  * [ Wiki  ](/introlab/rtabmap_ros/wiki)
  * [ Security  ](/introlab/rtabmap_ros/security)
  * [ Insights  ](/introlab/rtabmap_ros/pulse)


Sorry, something went wrong.


[ ![Screenshot from 2022-02-20 19-02-59](https://user-
images.githubusercontent.com/99226572/154837838-550d1a10-9692-414e-a91a-7d329fcce85c.png)
](https://user-
images.githubusercontent.com/99226572/154837838-550d1a10-9692-414e-a91a-7d329fcce85c.png)


  1.2 CMakeLists.txt  ï

Navigate one level back to the ` learning_tf2_cpp  ` directory, where the `
CMakeLists.txt  ` and ` package.xml  ` files are located.

Now open the ` CMakeLists.txt  ` add the executable and name it `
turtle_tf2_broadcaster  ` , which youâll use later with ` ros2  run  ` .

    add_executable(turtle_tf2_broadcaster src/turtle_tf2_broadcaster.cpp)
    ament_target_dependencies(
        turtle_tf2_broadcaster
        geometry_msgs
        rclcpp
        tf2
        tf2_ros
        turtlesim
    )

Finally, add the ` install(TARGETSâ¦)  ` section so ` ros2  run  ` can find
your executable:

    install(TARGETS
        turtle_tf2_broadcaster
        DESTINATION lib/${PROJECT_NAME})


Query


    sudo apt install ros-melodic-rtabmap-ros

---

All reactions


* [ tf ](/questions/scope:all/sort:activity-desc/tags:tf/page:1/)


[ Sign up for free ](/join?source=comment-repo) **to join this conversation on
GitHub** . Already have an account? [ Sign in to comment
](/login?return_to=https%3A%2F%2Fgithub.com%2Fintrolab%2Frtabmap_ros%2Fissues%2F960)


[ Map disappear after load map ](/question/315639/map-disappear-after-load-
map/)


[ ](https://github.com/)


  * [ Code  ](/introlab/rtabmap_ros)
  * [ Issues  ](/introlab/rtabmap_ros/issues)
  * [ Pull requests  ](/introlab/rtabmap_ros/pulls)
  * [ Actions  ](/introlab/rtabmap_ros/actions)
  * [ Projects  ](/introlab/rtabmap_ros/projects)
  * [ Wiki  ](/introlab/rtabmap_ros/wiki)
  * [ Security  ](/introlab/rtabmap_ros/security)
  * [ Insights  ](/introlab/rtabmap_ros/pulse)


    <node pkg="tf" type="static_transform_publisher"  name="base_to_realsense"
          args="0 0 0 0 0 0 /base_link /camera_link 100" />


[ Descartes package in ROS Kinetic Error ](/question/294176/descartes-package-
in-ros-kinetic-error/)


after that, uninstall the binaries.


[ https://answers.ros.org/question/1880...
](https://answers.ros.org/question/188046/tf-lookup-would-require-
extrapolation-into-the-future/)


    ROS1 melodic.
    ubuntu 18.04
    sensor : rgb-d camera(d435) only


Search


* Open Source


Name


[ ![Screenshot from 2022-02-24 13-01-16](https://user-
images.githubusercontent.com/99226572/155456097-38a82ea8-e388-40a3-bcd9-4b7c29688cf8.png)
](https://user-
images.githubusercontent.com/99226572/155456097-38a82ea8-e388-40a3-bcd9-4b7c29688cf8.png)

---

All reactions


Additional navigation options


[ Hi there! Please sign in
](/account/signin/?next=/question/360524/hector_mapping-transform-fails-after-
some-time/) [ help ](/help/ "help")


{{ message }}


[ ![@kdhRGT](https://avatars.githubusercontent.com/u/99226572?s=80&v=4)
](/kdhRGT)


###  Related Topics


|  1  |  740  |  July 18, 2019
[ Announcing tf_remapper_cpp and static_transform_mux: More power to your TF!
](https://discourse.ros.org/t/announcing-tf-remapper-cpp-and-static-transform-
mux-more-power-to-your-tf/9219)


Gazebo would publish the topic ` /odom ` and the TF ` odom->base_link ` ,
which will change as soon as the robot is moving. ` rtabmap ` will publish TF
` map->odom ` , which will change only when a loop closure is detected.

---

All reactions


Thanks.

---

The text was updated successfully, but these errors were encountered:


**so now my current tf tree is this**


New issue


All reactions


#  3 Build  ï

Run ` rosdep  ` in the root of your workspace to check for missing
dependencies.

Linux  macOS  Windows

    rosdep install -i --from-path src --rosdistro humble -y

rosdep only runs on Linux, so you will need to install ` geometry_msgs  ` and
` turtlesim  ` dependencies yourself

rosdep only runs on Linux, so you will need to install ` geometry_msgs  ` and
` turtlesim  ` dependencies yourself

Still in the root of your workspace, build your package:

Linux  macOS  Windows

    colcon build --packages-select learning_tf2_cpp

    colcon build --packages-select learning_tf2_cpp

    colcon build --merge-install --packages-select learning_tf2_cpp

Open a new terminal, navigate to the root of your workspace, and source the
setup files:

Linux  macOS  Windows


None yet


* [ GitHub Sponsors  Fund open source developers  ](/sponsors)


[
![@farishajdarpasic](https://avatars.githubusercontent.com/u/83273784?s=80&v=4)
](/farishajdarpasic)


received signal SIGSEGV, segmentation fault. cv::Mat::copySize ~~


[ ![Screenshot from 2022-02-21 19-28-16](https://user-
images.githubusercontent.com/99226572/154937838-204af1a7-0255-4845-a474-1ed8c4546066.png)
](https://user-
images.githubusercontent.com/99226572/154937838-204af1a7-0255-4845-a474-1ed8c4546066.png)

---

All reactions


    * [ CI/CD & Automation ](/solutions/ci-cd/)
    * [ DevOps ](/solutions/devops/)
    * [ DevSecOps  ](https://resources.github.com/devops/fundamentals/devsecops/)


Follow


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=80&v=4)
](/matlabbe)


Open


Resources


but now I have a small problem.


[ how to display video we get from cv_bridge? ](/question/309796/how-to-
display-video-we-get-from-cv_bridge/)


  Background  ï

In the next two tutorials we will write the code to reproduce the demo from
the [ Introduction to tf2  ](Introduction-To-Tf2.html) tutorial. After that,
the following tutorials focus on extending the demo with more advanced tf2
features, including the usage of timeouts in transformation lookups and time
travel.


Cancel  Create saved search


Milestone


Cancel  Submit feedback


**I've referred to following questions and tried solutions/ideas in all of
their answers/comments but nothing works:**


Labels


    * [ Learning Pathways  ](https://resources.github.com/learn/pathways/)
    * [ White papers, Ebooks, Webinars  ](https://resources.github.com/)
    * [ Customer Stories ](/customer-stories)
    * [ Partners  ](https://partner.github.com/)


Right there you can type "bt" in gdb after the seg fault to see the full
backtrace (from which function in rtabmap it happened).


To see all available qualifiers, see our [ documentation
](https://docs.github.com/search-github/github-code-search/understanding-
github-code-search-syntax) .


#  2 Write the launch file  ï

Now create a launch file for this demo. With your text editor, create a new
file called ` turtle_tf2_demo.launch.py  ` in the ` launch  ` folder, and add
the following lines:

    from launch import LaunchDescription
    from launch_ros.actions import Node

    def generate_launch_description():
        return LaunchDescription([
            Node(
                package='turtlesim',
                executable='turtlesim_node',
                name='sim'
            ),
            Node(
                package='learning_tf2_cpp',
                executable='turtle_tf2_broadcaster',
                name='broadcaster1',
                parameters=[
                    {'turtlename': 'turtle1'}
                ]
            ),
        ])


**my System**


**[ shrinivas96 ](/shrinivas96) ** commented  Jun 13, 2023  •


Development


edited


##  Footer


    * [ Actions  Automate any workflow  ](/features/actions)
    * [ Packages  Host and manage packages  ](/features/packages)
    * [ Security  Find and fix vulnerabilities  ](/features/security)
    * [ Codespaces  Instant dev environments  ](/features/codespaces)
    * [ Copilot  Write better code with AI  ](/features/copilot)
    * [ Code review  Manage code changes  ](/features/code-review)
    * [ Issues  Plan and track work  ](/features/issues)
    * [ Discussions  Collaborate outside of code  ](/features/discussions)


**[ matlabbe ](/matlabbe) ** commented  Feb 25, 2022


Last updated: **Aug 28 '20**


it seems like...my input image size has a problem....???


  2.3 CMakeLists.txt  ï

Reopen ` CMakeLists.txt  ` and add the line so that the launch files from the
` launch/  ` folder will be installed.

    install(DIRECTORY launch
      DESTINATION share/${PROJECT_NAME})

You can learn more about creating launch files in [ this tutorial
](../Launch/Creating-Launch-Files.html) .


_#0 in cv::Mat::copySize(cv::Mat const&) () at /usr/lib/x86_64-linux...
_#1 in rtabmap::transform::transform(rtabmap::transform const&)
....


Hello author!


Jump to bottom


#  1 Write the broadcaster node  ï

Letâs first create the source files. Go to the ` learning_tf2_cpp  ` package
we created in the previous tutorial. Inside the ` src  ` directory download
the example broadcaster code by entering the following command:

Linux  macOS  Windows

    wget https://raw.githubusercontent.com/ros/geometry_tutorials/ros2/turtle_tf2_cpp/src/turtle_tf2_broadcaster.cpp

    wget https://raw.githubusercontent.com/ros/geometry_tutorials/ros2/turtle_tf2_cpp/src/turtle_tf2_broadcaster.cpp

In a Windows command line prompt:

    curl -sk https://raw.githubusercontent.com/ros/geometry_tutorials/ros2/turtle_tf2_cpp/src/turtle_tf2_broadcaster.cpp -o turtle_tf2_broadcaster.cpp

Or in powershell:

    curl https://raw.githubusercontent.com/ros/geometry_tutorials/ros2/turtle_tf2_cpp/src/turtle_tf2_broadcaster.cpp -o turtle_tf2_broadcaster.cpp

Open the file using your preferred text editor.

    #include <functional>
    #include <memory>
    #include <sstream>
    #include <string>


Copy link


    cd rtabmap/build
    make
    sudo make uninstall


Pick a username


{{ message }}


Projects


#  [ Hector_mapping results in tf transformation error ](/t/hector-mapping-
results-in-tf-transformation-error/3396)


#  how to connect map->odom tf ?  #721


[ **asked 2020-08-28 09:27:29 -0500  ** ](/questions/360524/revisions/)


Skip to content


**[ matlabbe ](/matlabbe) ** commented  May 6, 2023


None yet


Thank you so much, sir.


ROS Resources: [ ROS Homepage ](http://ros.org/) | [ Media and Trademarks
](https://www.ros.org/blog/media/) | [ Documentation ](http://docs.ros.org/) |
[ ROS Index ](https://index.ros.org/) | [ How to Get Help
](http://wiki.ros.org/Support) | [ Q&A Help Site
](https://robotics.stackexchange.com/) | [ Discussion Forum
](http://discourse.ros.org/) | [ Service Status ](http://status.ros.org/)
---

[ ROS Discourse ](/)


|  [ Ask Your Question ](/questions/ask/)
---|---|---|---

0


  * [ Notifications ](/login?return_to=%2Fintrolab%2Frtabmap_ros)
  * [ Fork  546  ](/login?return_to=%2Fintrolab%2Frtabmap_ros)
  * [ Star  890  ](/login?return_to=%2Fintrolab%2Frtabmap_ros)


[ General  ](/c/general/8)


[ kdhRGT ](/kdhRGT) opened this issue  Feb 20, 2022  · 7 comments


[ ROS 2 Documentation: Humble ![Logo](../../../_static/humble-small.png)
](../../../index.html)

  * [ Installation ](../../../Installation.html)
    * [ Ubuntu (Debian packages) ](../../../Installation/Ubuntu-Install-Debians.html)
    * [ Windows (binary) ](../../../Installation/Windows-Install-Binary.html)
    * [ RHEL (RPM packages) ](../../../Installation/RHEL-Install-RPMs.html)
    * [ Alternatives ](../../../Installation/Alternatives.html)
      * [ Ubuntu (source) ](../../../Installation/Alternatives/Ubuntu-Development-Setup.html)
      * [ Ubuntu (binary) ](../../../Installation/Alternatives/Ubuntu-Install-Binary.html)
      * [ Windows (source) ](../../../Installation/Alternatives/Windows-Development-Setup.html)
      * [ RHEL (source) ](../../../Installation/Alternatives/RHEL-Development-Setup.html)
      * [ RHEL (binary) ](../../../Installation/Alternatives/RHEL-Install-Binary.html)
      * [ macOS (source) ](../../../Installation/Alternatives/macOS-Development-Setup.html)
      * [ Fedora (source) ](../../../Installation/Alternatives/Fedora-Development-Setup.html)
      * [ Latest development (source) ](../../../Installation/Alternatives/Latest-Development-Setup.html)
    * [ Maintain source checkout ](../../../Installation/Maintaining-a-Source-Checkout.html)
    * [ Testing with pre-release binaries ](../../../Installation/Testing.html)
    * [ DDS implementations ](../../../Installation/DDS-Implementations.html)
      * [ Connext security plugins ](../../../Installation/DDS-Implementations/Install-Connext-Security-Plugins.html)
      * [ RTI Connext DDS ](../../../Installation/DDS-Implementations/Install-Connext-University-Eval.html)
      * [ Eclipse Cyclone DDS ](../../../Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html)
      * [ GurumNetworks GurumDDS ](../../../Installation/DDS-Implementations/Working-with-GurumNetworks-GurumDDS.html)
      * [ eProsima Fast DDS ](../../../Installation/DDS-Implementations/Working-with-eProsima-Fast-DDS.html)
  * [ Distributions ](../../../Releases.html)
    * [ Iron Irwini ( ` iron  ` ) ](../../../Releases/Release-Iron-Irwini.html)
      * [ Iron Irwini Changelog ](../../../Releases/Iron-Irwini-Complete-Changelog.html)
    * [ Humble Hawksbill ( ` humble  ` ) ](../../../Releases/Release-Humble-Hawksbill.html)
      * [ Humble Hawksbill changelog ](../../../Releases/Humble-Hawksbill-Complete-Changelog.html)
    * [ Rolling Ridley ( ` rolling  ` ) ](../../../Releases/Release-Rolling-Ridley.html)
    * [ Development Distribution ](../../../Releases/Development.html)
      * [ Jazzy Jalisco ( ` jazzy  ` ) ](../../../Releases/Release-Jazzy-Jalisco.html)
    * [ End-of-Life Distributions ](../../../Releases/End-of-Life.html)
      * [ Galactic Geochelone ( ` galactic  ` ) ](../../../Releases/Release-Galactic-Geochelone.html)
        * [ Galactic Geochelone changelog ](../../../Releases/Galactic-Geochelone-Complete-Changelog.html)
      * [ Foxy Fitzroy ( ` foxy  ` ) ](../../../Releases/Release-Foxy-Fitzroy.html)
      * [ Eloquent Elusor ( ` eloquent  ` ) ](../../../Releases/Release-Eloquent-Elusor.html)
      * [ Dashing Diademata ( ` dashing  ` ) ](../../../Releases/Release-Dashing-Diademata.html)
      * [ Crystal Clemmys ( ` crystal  ` ) ](../../../Releases/Release-Crystal-Clemmys.html)
      * [ Bouncy Bolson ( ` bouncy  ` ) ](../../../Releases/Release-Bouncy-Bolson.html)


Sign up for GitHub


    cd ~/rtabmap/build
    sudo make install


for the binaries:


[ parzival ](/users/35453/parzival/)
463  ●  36  ●  62  ●  59  [ https://jashmota.com ](https://jashmota.com
"parzival's website is https://jashmota.com")


Sorry I think I misunderstand what you wanted because I was not friendly with
gdb.


By Solution


Sorry, something went wrong.


Already on GitHub? [ Sign in
](/login?return_to=%2Fintrolab%2Frtabmap_ros%2Fissues%2Fnew%2Fchoose) to your
account


  2.2 Add dependencies  ï

Navigate one level back to the ` learning_tf2_cpp  ` directory, where the `
CMakeLists.txt  ` and ` package.xml  ` files are located.

Open ` package.xml  ` with your text editor. Add the following dependencies
corresponding to your launch fileâs import statements:

    <exec_depend>launch</exec_depend>
    <exec_depend>launch_ros</exec_depend>

This declares the additional required ` launch  ` and ` launch_ros  `
dependencies when its code is executed.

Make sure to save the file.


Closed


    * [ Documenting a ROS 2 package ](../../../How-To-Guides/Documenting-a-ROS-2-Package.html)
    * [ ament_cmake user documentation ](../../../How-To-Guides/Ament-CMake-Documentation.html)
    * [ ament_cmake_python user documentation ](../../../How-To-Guides/Ament-CMake-Python-Documentation.html)
    * [ Migrating from ROS 1 to ROS 2 ](../../../How-To-Guides/Migrating-from-ROS1.html)
      * [ Migrating Packages ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-Packages.html)
      * [ Migrating Interfaces ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-Interfaces.html)
      * [ Migrating C++ Packages ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-CPP-Packages.html)
      * [ Migrating Python Packages ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-Python-Packages.html)
      * [ Migrating Launch Files ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-Launch-Files.html)
      * [ Migrating Parameters ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-Parameters.html)
      * [ Migrating Scripts ](../../../How-To-Guides/Migrating-from-ROS1/Migrating-Scripts.html)
    * [ Using Python, XML, and YAML for ROS 2 Launch Files ](../../../How-To-Guides/Launch-file-different-formats.html)
    * [ Using ROS 2 launch to launch composable nodes ](../../../How-To-Guides/Launching-composable-nodes.html)
    * [ Passing ROS arguments to nodes via the command-line ](../../../How-To-Guides/Node-arguments.html)
    * [ Synchronous vs. asynchronous service clients ](../../../How-To-Guides/Sync-Vs-Async.html)
    * [ DDS tuning information ](../../../How-To-Guides/DDS-tuning.html)
    * [ rosbag2: Overriding QoS Policies ](../../../How-To-Guides/Overriding-QoS-Policies-For-Recording-And-Playback.html)
    * [ Working with multiple ROS 2 middleware implementations ](../../../How-To-Guides/Working-with-multiple-RMW-implementations.html)
    * [ Cross-compilation ](../../../How-To-Guides/Cross-compilation.html)
    * [ Releasing a Package ](../../../How-To-Guides/Releasing/Releasing-a-Package.html)
      * [ First Time Release ](../../../How-To-Guides/Releasing/First-Time-Release.html)
      * [ Subsequent Releases ](../../../How-To-Guides/Releasing/Subsequent-Releases.html)
      * [ Release Team / Repository ](../../../How-To-Guides/Releasing/Release-Team-Repository.html)
      * [ Release Track ](../../../How-To-Guides/Releasing/Release-Track.html)
    * [ Using Python Packages with ROS 2 ](../../../How-To-Guides/Using-Python-Packages.html)
    * [ Porting RQt plugins to Windows ](../../../How-To-Guides/RQt-Port-Plugin-Windows.html)
    * [ Running ROS 2 nodes in Docker [community-contributed] ](../../../How-To-Guides/Run-2-nodes-in-single-or-separate-docker-containers.html)
    * [ Visualizing ROS 2 data with Foxglove Studio ](../../../How-To-Guides/Visualizing-ROS-2-Data-With-Foxglove-Studio.html)
    * [ ROS 2 Package Maintainer Guide ](../../../How-To-Guides/Package-maintainer-guide.html)
    * [ Building a custom Debian package ](../../../How-To-Guides/Building-a-Custom-Debian-Package.html)
    * [ Building ROS 2 with tracing instrumentation ](../../../How-To-Guides/Building-ROS-2-with-Tracing-Instrumentation.html)
    * [ Topics vs Services vs Actions ](../../../How-To-Guides/Topics-Services-Actions.html)
    * [ Using variants ](../../../How-To-Guides/Using-Variants.html)
    * [ Using the ` ros2  param  ` command-line tool ](../../../How-To-Guides/Using-ros2-param.html)
    * [ Using ` ros1_bridge  ` with upstream ROS on Ubuntu 22.04 ](../../../How-To-Guides/Using-ros1_bridge-Jammy-upstream.html)
    * [ Configure Zero Copy Loaned Messages ](../../../How-To-Guides/Configure-ZeroCopy-loaned-messages.html)
    * [ ROS 2 on Raspberry Pi ](../../../How-To-Guides/Installing-on-Raspberry-Pi.html)
    * [ Using Callback Groups ](../../../How-To-Guides/Using-callback-groups.html)
    * [ IDEs and Debugging [community-contributed] ](../../../How-To-Guides/ROS-2-IDEs.html)
    * [ Setup ROS 2 with VSCode and Docker [community-contributed] ](../../../How-To-Guides/Setup-ROS-2-with-VSCode-and-Docker-Container.html)


I got some hints from your last answer.


**[ matlabbe ](/matlabbe) ** commented  Feb 23, 2022  •


None yet


[ ![Screenshot from 2022-02-23 15-46-40](https://user-
images.githubusercontent.com/99226572/155273953-76a07619-9350-4593-8b3c-2975b4fce180.png)
](https://user-
images.githubusercontent.com/99226572/155273953-76a07619-9350-4593-8b3c-2975b4fce180.png)


* Solutions


[ ![@hatem-
darweesh](https://avatars.githubusercontent.com/u/20182801?s=80&u=1c2fa6643bf02986a02c3463dcee1e821bdbc554&v=4)
](/hatem-darweesh)


* [ hector_mapping ](/questions/scope:all/sort:activity-desc/tags:hector_mapping/page:1/)


Did you start ` rtabmap_slam/rtabmap ` node? Is it outputting warnings that
some topics are not received?

---

All reactions


[ frames_rosbag.pdf
](https://github.com/introlab/rtabmap_ros/files/8103731/frames_rosbag.pdf)


Copy link


  * [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
  * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
  * [ Security ](/security)
  * [ Status ](https://www.githubstatus.com/)
  * [ Docs ](https://docs.github.com/)
  * [ Contact ](https://support.github.com?tags=dotcom-footer)
  * Manage cookies
  * Do not share my personal information


[ Robot_localization: odometry/gps no output info
](/question/340729/robot_localization-odometrygps-no-output-info/)


**Time:** 15 minutes

Contents

  * Background

  * Prerequisites

  * Tasks

    * 1 Write the broadcaster node

    * 2 Write the launch file

    * 3 Build

    * 4 Run

  * Summary


* Product


**System setup:** TFs are available for map->odom->base_link->laser, map->odom
given by hector_mapping, odom->base_link given by differential drive,
base_link->laser by a static transform publisher. Robot computer is a
raspberry pi 3b, workstation computer is an Intel i5, both running Ubuntu
16.04 ROS Kinetic, time synced via ntpdate using time server at [
time.windows.com ](http://time.windows.com) . Hector_mapping and rviz is run
via workstation computer to make sure it is not an issue with limited compute
power.


Glad that you've found a solution,
Mathieu

---

All reactions


My question is:
How can I get the corrected odometry with respect to the "map" frame.


No milestone


If the rtabmap binaries were installed before building rtabmap_ros,
rtabmap_ros could have been using headers from /usr/local instead of the
binaries in /opt/ros, then on runtime the wrong version of rtabmap libraries
were loaded causing the crash.


    t.header.stamp = this->get_clock()->now();
    t.header.frame_id = "world";
    t.child_frame_id = turtlename_.c_str();

Here we copy the information from the 3D turtle pose into the 3D transform.

    // Turtle only exists in 2D, thus we get x and y translation
    // coordinates from the message and set the z coordinate to 0
    t.transform.translation.x = msg->x;
    t.transform.translation.y = msg->y;
    t.transform.translation.z = 0.0;

    // For the same reason, turtle can only rotate around one axis
    // and this why we set rotation in x and y to 0 and obtain
    // rotation in z axis from the message
    tf2::Quaternion q;
    q.setRPY(0, 0, msg->theta);
    t.transform.rotation.x = q.x();
    t.transform.rotation.y = q.y();
    t.transform.rotation.z = q.z();
    t.transform.rotation.w = q.w();

Finally we take the transform that we constructed and pass it to the `
sendTransform  ` method of the ` TransformBroadcaster  ` that will take care
of broadcasting.

    // Send the transformation
    tf_broadcaster_->sendTransform(t);


[ kinetic ](https://discourse.ros.org/tag/kinetic)


[ General  ](/c/general/8)


[ ALL ](/questions/scope:all/sort:activity-desc/page:1/) [ UNANSWERED
](/questions/scope:unanswered/sort:answers-asc/page:1/)


We read every piece of feedback, and take your input very seriously.


[ERROR] [1513111318.589547578, 1512355461.660118665]: Transform failed during
publishing of map_odom transform: Lookup would require extrapolation into the
future. Requested time 1512355460.650420421 but the latest data is at time
1512355460.113152033, when looking up transform from frame [base_link] to
frame [nav]


[ nathangeorge1  ](https://discourse.ros.org/u/nathangeorge1) November 15,
2018, 6:25pm  4


Copy link


**I added some commands on the launch file like this in rtabmap.launch**


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=80&v=4)
](/matlabbe)


Password


Clear


#  Saved searches


Closed


#  how to connect map->odom tf ?  #721


Saurabh


Sorry, something went wrong.


Can you guess which I did a mistake?


Member


No one assigned


I am successful to build the ROS workspace!!!!!!


Email Address


  *[
              2020-08-28 09:27:29 -0500
             ]: 2020-08-28 09:27:29 -0500
  *[
             2020-08-29 03:08:18 -0500
            ]: 2020-08-29 03:08:18 -0500
  *[
        2020-08-28 09:27:29 -0500
       ]: 2020-08-28 09:27:29 -0500
  *[
        2024-04-17 01:02:50 -0500
       ]: 2024-04-17 01:02:50 -0500


Best regards


**So I found a similar issue on it**


Was your error resolved?


thank you so much


In latest version, the new default is that ` /rtabmap/localization_pose ` is
always published, unless [ ` pub_loc_pose_only_when_localizing `
](https://github.com/introlab/rtabmap_ros/commit/1a87f1598df2a40d01b230808074b45c9a26039e)
is true.


Thank you so much for your help.


[ ![ gravatar image]() ]() [ ]() (  2024-04-17 01:02:50 -0500  )  edit


Explore


How to avoid this tf race condition?


All these (#)are errors? I am not sure that that is the reason why I attached
a full picture of the error window.

---

All reactions


[
![@shrinivas96](https://avatars.githubusercontent.com/u/19876821?s=80&u=e8f75167ca022d9e4b31ec21ff62f25613377cdb&v=4)
](/shrinivas96)


So, ` map->odom ` is only changed when a loop closure is detected, and
publishing to the topic ` /rtabmap/localization_pose ` is only happening also
when loop closure is detected.


Sorry, something went wrong.


  * [ Code  ](/introlab/rtabmap_ros)
  * [ Issues  428  ](/introlab/rtabmap_ros/issues)
  * [ Pull requests  0  ](/introlab/rtabmap_ros/pulls)
  * [ Actions  ](/introlab/rtabmap_ros/actions)
  * [ Projects  0  ](/introlab/rtabmap_ros/projects)
  * [ Wiki  ](/introlab/rtabmap_ros/wiki)
  * [ Security  ](/introlab/rtabmap_ros/security)
  * [ Insights  ](/introlab/rtabmap_ros/pulse)


Cancel  Create saved search


[ ![parzival gravatar
image](//www.gravatar.com/avatar/8088536535cbaec0fcb48aa33bd1b3fc?s=16&d=identicon&r=PG)
](/users/35453/parzival/) [ parzival ](/users/35453/parzival/) (  2020-08-29
03:08:18 -0500  )  edit


sudo apt-get remove ros-melodic-rtabmap ros-melodic-rtabmap-ros


###  Footer navigation


edited


Jump to bottom


Development


Hello, author~!


##  Footer


[ hatem-darweesh ](/hatem-darweesh) opened this issue  Apr 27, 2023  · 5
comments


Transform failed during publishing of map_odom transform: Lookup would require extrapolation into the future.  Requested time 1598623117.729725247 but the latest data is at time 1598623117.563725413, when looking up transform from frame [base_link] to frame [odom]


**firstly rtabmap said errors like this**


    cd ~/rtabmap/build
    make
    sudo make uninstall


#  4 Run  ï

Now run the launch file that will start the turtlesim simulation node and `
turtle_tf2_broadcaster  ` node:

    ros2 launch learning_tf2_cpp turtle_tf2_demo.launch.py

In the second terminal window type the following command:

    ros2 run turtlesim turtle_teleop_key

You will now see that the turtlesim simulation have started with one turtle
that you can control.

![../../../_images/turtlesim_broadcast.png](../../../_images/turtlesim_broadcast.png)

Now, use the ` tf2_echo  ` tool to check if the turtle pose is actually
getting broadcast to tf2:

    ros2 run tf2_ros tf2_echo world turtle1

This should show you the pose of the first turtle. Drive around the turtle
using the arrow keys (make sure your ` turtle_teleop_key  ` terminal window is
active, not your simulator window). In your console output you will see
something similar to this:

    At time 1625137663.912474878
    - Translation: [5.276, 7.930, 0.000]
    - Rotation: in Quaternion [0.000, 0.000, 0.934, -0.357]


[ Sign in
](/login?return_to=https%3A%2F%2Fgithub.com%2Fintrolab%2Frtabmap_ros%2Fissues%2F960)


can you help me with how to connect odom frame with map frame?


      * [ Launch ](../Launch/Launch-Main.html)
        * [ Creating a launch file ](../Launch/Creating-Launch-Files.html)
        * [ Integrating launch files into ROS 2 packages ](../Launch/Launch-system.html)
        * [ Using substitutions ](../Launch/Using-Substitutions.html)
        * [ Using event handlers ](../Launch/Using-Event-Handlers.html)
        * [ Managing large projects ](../Launch/Using-ROS2-Launch-For-Large-Projects.html)
      * [ ` tf2  ` ](Tf2-Main.html)
        * [ Introducing ` tf2  ` ](Introduction-To-Tf2.html)
        * [ Writing a static broadcaster (Python) ](Writing-A-Tf2-Static-Broadcaster-Py.html)
        * [ Writing a static broadcaster (C++) ](Writing-A-Tf2-Static-Broadcaster-Cpp.html)
        * [ Writing a broadcaster (Python) ](Writing-A-Tf2-Broadcaster-Py.html)
        * Writing a broadcaster (C++)
        * [ Writing a listener (Python) ](Writing-A-Tf2-Listener-Py.html)
        * [ Writing a listener (C++) ](Writing-A-Tf2-Listener-Cpp.html)
        * [ Adding a frame (Python) ](Adding-A-Frame-Py.html)
        * [ Adding a frame (C++) ](Adding-A-Frame-Cpp.html)
        * [ Using time (Python) ](Learning-About-Tf2-And-Time-Py.html)
        * [ Using time (C++) ](Learning-About-Tf2-And-Time-Cpp.html)
        * [ Traveling in time (Python) ](Time-Travel-With-Tf2-Py.html)
        * [ Traveling in time (C++) ](Time-Travel-With-Tf2-Cpp.html)
        * [ Debugging ](Debugging-Tf2-Problems.html)
        * [ Quaternion fundamentals ](Quaternion-Fundamentals.html)
        * [ Using stamped datatypes with ` tf2_ros::MessageFilter  ` ](Using-Stamped-Datatypes-With-Tf2-Ros-MessageFilter.html)
      * [ Testing ](../Testing/Testing-Main.html)
        * [ Running Tests in ROS 2 from the Command Line ](../Testing/CLI.html)
        * [ Writing Basic Tests with C++ with GTest ](../Testing/Cpp.html)
        * [ Writing Basic Tests with Python ](../Testing/Python.html)
      * [ URDF ](../URDF/URDF-Main.html)
        * [ Building a visual robot model from scratch ](../URDF/Building-a-Visual-Robot-Model-with-URDF-from-Scratch.html)
        * [ Building a movable robot model ](../URDF/Building-a-Movable-Robot-Model-with-URDF.html)
        * [ Adding physical and collision properties ](../URDF/Adding-Physical-and-Collision-Properties-to-a-URDF-Model.html)
        * [ Using Xacro to clean up your code ](../URDF/Using-Xacro-to-Clean-Up-a-URDF-File.html)
        * [ Using URDF with ` robot_state_publisher  ` ](../URDF/Using-URDF-with-Robot-State-Publisher.html)
        * [ Generating an URDF File ](../URDF/Exporting-an-URDF-File.html)
      * [ RViz ](../RViz/RViz-Main.html)
        * [ RViz User Guide ](../RViz/RViz-User-Guide/RViz-User-Guide.html)
        * [ Building a Custom RViz Display ](../RViz/RViz-Custom-Display/RViz-Custom-Display.html)
    * [ Advanced ](../../Advanced.html)
      * [ Enabling topic statistics (C++) ](../../Advanced/Topic-Statistics-Tutorial/Topic-Statistics-Tutorial.html)
      * [ Using Fast DDS Discovery Server as discovery protocol [community-contributed] ](../../Advanced/Discovery-Server/Discovery-Server.html)


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=52&v=4)
](/matlabbe) [
![@kdhRGT](https://avatars.githubusercontent.com/u/99226572?s=52&v=4)
](/kdhRGT)


  * [ Code  ](/introlab/rtabmap_ros)
  * [ Issues  ](/introlab/rtabmap_ros/issues)
  * [ Pull requests  ](/introlab/rtabmap_ros/pulls)
  * [ Actions  ](/introlab/rtabmap_ros/actions)
  * [ Projects  ](/introlab/rtabmap_ros/projects)
  * [ Wiki  ](/introlab/rtabmap_ros/wiki)
  * [ Security  ](/introlab/rtabmap_ros/security)
  * [ Insights  ](/introlab/rtabmap_ros/pulse)


I can run rtabmap by my rosbag dataset. but it said some errors.


Asked: ** 2020-08-28 09:27:29 -0500  **


Powered by [ Discourse ](https://www.discourse.org) , best viewed with
JavaScript enabled


In the documentation, the rtabmap_ros node should output additional /tf which
is the corrected odometry from rgbd_odometry node.


      * [ Implementing a custom memory allocator ](../../Advanced/Allocator-Template-Tutorial.html)
      * [ Unlocking the potential of Fast DDS middleware [community-contributed] ](../../Advanced/FastDDS-Configuration.html)
      * [ Recording a bag from a node (C++) ](../../Advanced/Recording-A-Bag-From-Your-Own-Node-CPP.html)
      * [ Recording a bag from a node (Python) ](../../Advanced/Recording-A-Bag-From-Your-Own-Node-Py.html)
      * [ Reading from a bag file (C++) ](../../Advanced/Reading-From-A-Bag-File-CPP.html)
      * [ Simulators ](../../Advanced/Simulators/Simulation-Main.html)
        * [ Webots ](../../Advanced/Simulators/Webots/Simulation-Webots.html)
          * [ Installation (Ubuntu) ](../../Advanced/Simulators/Webots/Installation-Ubuntu.html)
          * [ Installation (Windows) ](../../Advanced/Simulators/Webots/Installation-Windows.html)
          * [ Installation (macOS) ](../../Advanced/Simulators/Webots/Installation-MacOS.html)
          * [ Setting up a robot simulation (Basic) ](../../Advanced/Simulators/Webots/Setting-Up-Simulation-Webots-Basic.html)
          * [ Setting up a robot simulation (Advanced) ](../../Advanced/Simulators/Webots/Setting-Up-Simulation-Webots-Advanced.html)
          * [ The Ros2Supervisor Node ](../../Advanced/Simulators/Webots/Simulation-Supervisor.html)
          * [ Setting up a Reset Handler ](../../Advanced/Simulators/Webots/Simulation-Reset-Handler.html)
        * [ Gazebo ](../../Advanced/Simulators/Gazebo/Simulation-Gazebo.html)
          * [ Setting up a robot simulation (Gazebo) ](../../Advanced/Simulators/Gazebo/Gazebo.html)
      * [ Security ](../../Advanced/Security/Security-Main.html)
        * [ Setting up security ](../../Advanced/Security/Introducing-ros2-security.html)
        * [ Understanding the security keystore ](../../Advanced/Security/The-Keystore.html)
        * [ Ensuring security across machines ](../../Advanced/Security/Security-on-Two.html)
        * [ Examining network traffic ](../../Advanced/Security/Examine-Traffic.html)
        * [ Setting access controls ](../../Advanced/Security/Access-Controls.html)
        * [ Deployment Guidelines ](../../Advanced/Security/Deployment-Guidelines.html)
    * [ Demos ](../../Demos.html)
      * [ Using quality-of-service settings for lossy networks ](../../Demos/Quality-of-Service.html)
      * [ Managing nodes with managed lifecycles ](../../Demos/Managed-Nodes.html)
      * [ Setting up efficient intra-process communication ](../../Demos/Intra-Process-Communication.html)
      * [ Recording and playing back data with ` rosbag  ` using the ROS 1 bridge ](../../Demos/Rosbag-with-ROS1-Bridge.html)
      * [ Understanding real-time programming ](../../Demos/Real-Time-Programming.html)
      * [ Experimenting with a dummy robot ](../../Demos/dummy-robot-demo.html)
      * [ Logging ](../../Demos/Logging-and-logger-configuration.html)
      * [ Creating a content filtering subscription ](../../Demos/Content-Filtering-Subscription.html)
    * [ Miscellaneous ](../../Miscellaneous.html)
      * [ Deploying on IBM Cloud Kubernetes [community-contributed] ](../../Miscellaneous/Deploying-ROS-2-on-IBM-Cloud.html)
      * [ Using Eclipse Oxygen with ` rviz2  ` [community-contributed] ](../../Miscellaneous/Eclipse-Oxygen-with-ROS-2-and-rviz2.html)
      * [ Building a real-time Linux kernel [community-contributed] ](../../Miscellaneous/Building-Realtime-rt_preempt-kernel-for-ROS-2.html)
      * [ Building a package with Eclipse 2021-06 ](../../Miscellaneous/Building-ROS2-Package-with-eclipse-2021-06.html)
  * [ How-to Guides ](../../../How-To-Guides.html)
    * [ Installation troubleshooting ](../../../How-To-Guides/Installation-Troubleshooting.html)
    * [ Developing a ROS 2 package ](../../../How-To-Guides/Developing-a-ROS-2-Package.html)


We read every piece of feedback, and take your input very seriously.


Sorry, something went wrong.


**Have a question about this project?** Sign up for a free GitHub account to
open an issue and contact its maintainers and the community.


[ https://answers.ros.org/question/3254...
](https://answers.ros.org/question/325486/tf2-transform-error-lookup-would-
require-extrapolation-into-the-past/)


Tasks  ï


[ edit ](/questions/360524/edit/) [ retag ](/s/questions/360524/retag/) flag
offensive  [ close ](/questions/360524/close/) merge  delete


###  Footer navigation


By clicking “Sign up for GitHub”, you agree to our [ terms of service
](https://docs.github.com/terms) and [ privacy statement
](https://docs.github.com/privacy) . We’ll occasionally send you account
related emails.


* Product


For me ` rtabmap_slam/rtabmap ` lauched without any warnings/errors. With `
view_frames ` , I can also see that there is a ` /map ->/odom ` published by `
/rtabmap/rtabamp ` . Does this mean that when I subscribe to ` /odom ` in this
case, I am getting the corrected poses? Is this basically localisation (i.e.
updating poses based on prediction-correction)?


Seen: **455 times**


Is rtabmap built from source or binaries?

---

All reactions


[ Sign up for free ](/join?source=comment-repo) **to join this conversation on
GitHub** . Already have an account? [ Sign in to comment
](/login?return_to=https%3A%2F%2Fgithub.com%2Fintrolab%2Frtabmap_ros%2Fissues%2F721)


[ hatem-darweesh ](/hatem-darweesh) opened this issue  Apr 27, 2023  · 5
comments


[ https://answers.ros.org/question/2972...
](https://answers.ros.org/question/297272/amcl-lookup-would-require-
extrapolation-into-the-future-requested-time-1531474550521278314-but-the-
latest-data-is-at-time-1531474550516698594-when/)


  * [ Notifications ](/login?return_to=%2Fintrolab%2Frtabmap_ros)
  * [ Fork  546  ](/login?return_to=%2Fintrolab%2Frtabmap_ros)
  * [ Star  890  ](/login?return_to=%2Fintrolab%2Frtabmap_ros)


[ introlab ](/introlab) /  **[ rtabmap_ros ](/introlab/rtabmap_ros) ** Public


* [ The ReadME Project  GitHub community articles  ](/readme)


  2.1 Examine the code  ï

First we import required modules from the ` launch  ` and ` launch_ros  `
packages. It should be noted that ` launch  ` is a generic launching framework
(not ROS 2 specific) and ` launch_ros  ` has ROS 2 specific things, like nodes
that we import here.

    from launch import LaunchDescription
    from launch_ros.actions import Node

Now we run our nodes that start the turtlesim simulation and broadcast `
turtle1  ` state to the tf2 using our ` turtle_tf2_broadcaster  ` node.

    Node(
        package='turtlesim',
        executable='turtlesim_node',
        name='sim'
    ),
    Node(
        package='learning_tf2_cpp',
        executable='turtle_tf2_broadcaster',
        name='broadcaster1',
        parameters=[
            {'turtlename': 'turtle1'}
        ]
    ),


**[ kdhRGT ](/kdhRGT) ** commented  Feb 24, 2022  •


[ ![@matlabbe](https://avatars.githubusercontent.com/u/2319645?s=80&v=4)
](/matlabbe)


[ ![@kdhRGT](https://avatars.githubusercontent.com/u/99226572?s=80&v=4)
](/kdhRGT)


**[ farishajdarpasic ](/farishajdarpasic) ** commented  Jul 10, 2023


1 follower


Author