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

bluemoon93's profile - activity

2022-05-18 17:17:01 -0500 received badge  Famous Question (source)
2021-08-02 20:54:42 -0500 received badge  Famous Question (source)
2021-02-22 17:08:57 -0500 received badge  Famous Question (source)
2021-01-29 06:24:27 -0500 received badge  Notable Question (source)
2020-11-16 18:39:14 -0500 received badge  Notable Question (source)
2020-09-15 10:35:39 -0500 received badge  Famous Question (source)
2020-08-02 08:19:36 -0500 received badge  Notable Question (source)
2020-08-02 08:19:36 -0500 received badge  Popular Question (source)
2020-06-06 05:00:08 -0500 received badge  Notable Question (source)
2020-04-21 10:26:48 -0500 asked a question rosbag2 doesn't record turtlebot3 scan messages

rosbag2 doesn't record turtlebot3 scan messages To reproduce this, simply follow TurtleBot3's simulation tutorials and s

2020-04-14 06:48:50 -0500 received badge  Popular Question (source)
2020-04-14 05:59:00 -0500 answered a question Adding parameters by command line in EloquentROS2 is not working like tutorial

@marguedas was correct. This was the correct code. int local_some_int; node->declare_parameter("some_int"); node-&g

2020-04-14 05:57:06 -0500 answered a question My Subscriber isn't picking up TurtleBot3's scans

@stevemacenski had it right. The Subscription had to be made with rclcpp::Subscription<sensor_msgs::msg::LaserScan&g

2020-04-14 05:57:06 -0500 received badge  Rapid Responder (source)
2020-04-14 04:32:06 -0500 received badge  Enthusiast
2020-04-13 22:25:38 -0500 received badge  Popular Question (source)
2020-04-13 10:41:02 -0500 edited question My Subscriber isn't picking up TurtleBot3's scans

My Subscriber isn't picking up TurtleBot3's scans Using ROS2 Dashing, running on the Dashing Docker environment, and usi

2020-04-13 10:41:02 -0500 received badge  Editor (source)
2020-04-13 10:40:44 -0500 asked a question My Subscriber isn't picking up TurtleBot3's scans

My Subscriber isn't picking up TurtleBot3's scans Using ROS2 Dashing, running on the Dashing Docker environment, and usi

2020-04-01 09:55:23 -0500 edited question Adding parameters by command line in EloquentROS2 is not working like tutorial

Adding parameters by command line in EloquentROS2 is not working like tutorial I'm following this tutorial to add a few

2020-04-01 09:44:03 -0500 asked a question Adding parameters by command line in EloquentROS2 is not working like tutorial

Adding parameters by command line in EloquentROS2 is not working like tutorial I'm following this tutorial to add a few

2020-03-27 09:45:29 -0500 marked best answer How to efficiently get TransformStamped in Eloquent?

I'm trying to build a geometry_msgs::msg::TransformStamped message, to send through a TransformBroadcaster.

void sendTransform(tf2:Transform myTf2Transform,  rclcpp::Time myTime, std::string global_frame, std::string child_frame)
{
    geometry_msgs::msg::TransformStamped tmp_tf_stamped;
    // ...
    tfb_->sendTransform(tmp_tf_stamped);
}

I tried to use tf2::convert to convert a tf2::Stamped<tf2::Transform> into geometry_msgs::msg::TransformStamped:

tf2::TimePoint myTimepoint; // TODO get tf2::TimePoint from rclcpp::Time
tf2::Stamped <tf2::Transform> test_stamped(myTf2Transform, myTimepoint, global_frame);
tf2::convert(test_stamped, tmp_tf_stamped);    
// /opt/ros/eloquent/include/tf2/impl/convert.h:65:12: error: no matching function for call to ‘toMsg(const tf2::Stamped<tf2::Transform>&)’
tmp_tf_stamped.child_frame_id = child_frame;

I then tried to create the message and just fill in its fields, converting the tf2:Transform into the geometry_msgs::msg::Transform type of the message field:

tmp_tf_stamped.child_frame_id = child_frame;
tmp_tf_stamped.header.frame_id = global_frame;
tmp_tf_stamped.header.stamp = myTime;

geometry_msgs::msg::Transform test_transform;
tf2::convert(latest_tf_.inverse(), test_transform); 
// /opt/ros/eloquent/include/tf2/impl/convert.h:65:12: error: no matching function for call to ‘toMsg(const tf2::Transform&)’
tmp_tf_stamped.transform = test_transform;

And finally I got it working by inputting each field by hand.

tmp_tf_stamped.child_frame_id = child_frame;
tmp_tf_stamped.header.frame_id = global_frame;
tmp_tf_stamped.header.stamp = myTime;
tmp_tf_stamped.transform.translation.x = myTf2Transform.getOrigin().x();
tmp_tf_stamped.transform.translation.y = myTf2Transform.getOrigin().y();
tmp_tf_stamped.transform.translation.z = myTf2Transform.getOrigin().z();
tmp_tf_stamped.transform.rotation.x = myTf2Transform.getRotation().x();
tmp_tf_stamped.transform.rotation.y = myTf2Transform.getRotation().y();
tmp_tf_stamped.transform.rotation.z = myTf2Transform.getRotation().z();
tmp_tf_stamped.transform.rotation.w = myTf2Transform.getRotation().w();

This feels quite inefficient, though. What is the recommended approach to do this?

2020-03-27 09:45:29 -0500 received badge  Scholar (source)
2020-03-27 09:43:57 -0500 commented answer How to efficiently get TransformStamped in Eloquent?

Yes, that works. I just have to find a way to convert rclcpp::Time to tf2:TimePoint

2020-03-27 08:28:22 -0500 commented answer How to efficiently get TransformStamped in Eloquent?

I did include that, yes. I've also added tf2_ros tf2_geometry_msgs geometry_msgs tf2 tf2_msgs to CMakeLists.txt and to p

2020-03-26 16:51:56 -0500 received badge  Popular Question (source)
2020-03-26 15:40:54 -0500 received badge  Supporter (source)
2020-03-26 07:04:26 -0500 asked a question How to efficiently get TransformStamped in Eloquent?

How to get TransformStamped in Eloquent? I'm trying to build a geometry_msgs::msg::TransformStamped message, to send thr

2020-03-26 07:04:26 -0500 answered a question No matching function when it exists

Try including the namespace, i.e., this->_map_to_odom = tf2::toMsg(tf_stamped_map_odom);