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

ateator's profile - activity

2021-09-21 13:21:51 -0500 received badge  Famous Question (source)
2021-02-20 15:07:16 -0500 received badge  Famous Question (source)
2020-11-17 10:44:22 -0500 received badge  Notable Question (source)
2020-11-16 11:05:31 -0500 edited answer ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

I found that my question was not stated correctly. Restated, it would be: I have Local Rotation Axis of all the joints a

2020-11-16 10:18:16 -0500 edited answer ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

I found that my question was not stated correctly. Restated, it would be: I have Local Rotation Axis of all the joints a

2020-11-16 10:16:48 -0500 marked best answer ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?
  • Ubuntu 18.04
  • ROS2 Eloquent
  • C++
  • TF
  • KDL
  • URDF
  • robot_state_publisher (but the Foxy version!)

Setup

I am running ROS2 Eloquent, but I copied the Foxy version of the robot_state_publisher from github to use in my own project. Inside robot_state_publisher (Foxy version!) I learned how to use setupURDF(...) to transform my URDF file into a URDF::Model, and subsequently copy the Joints from that Model into a MimicMap. This MimicMap is used inside the JointState callback and ultimately end up at publishTransforms. In short, the URDF Model and JointStateMsg (sensor_msgs::msg::JointState) are used to populate at a TransformStampedMsg (geometry_msgs::msg::TransformStamped), which is published for anyone to use. I can see that a bulk of the magic is done with the KDL namespace, which manages the tree, segments, joints, links, plus more, and allows us to get poses of a segment based on the current joint position.

Question

Is there a way for me to get 'live' (or Global) Joint Axis pose (with the applied joint_positions) using functions already provided to me by KDL or another ROS library? If not, how do I apply my joint rotations to the segments so that I can calculate the Forward Kinematics for the Axis of Rotation for each joint?

2020-11-16 10:16:42 -0500 answered a question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

I found that my question was not stated correctly. Restated, it would be: I have Local Rotation Axis of all the joints a

2020-11-15 11:59:37 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

I am looking for information on how to get the orientation for the Joint Axis (or Axis of Rotation for the associated jo

2020-11-15 02:15:18 -0500 received badge  Popular Question (source)
2020-11-14 11:28:26 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

I don't have any problem with ROS2, my system, my package or the robot_state_publisher node itself. My system works exac

2020-11-14 11:27:51 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

At first, I was trying to understand the usage of joint_state_publisher and robot_state_publisher, so I investigated the

2020-11-14 11:26:50 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

At first, I was trying to understand the usage of joint_state_publisher and robot_state_publisher, so I investigated the

2020-11-14 11:25:44 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

At first, I was trying to understand the usage of joint_state_publisher and robot_state_publisher, so I investigated the

2020-11-14 11:25:02 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

I don't have any problem with ROS2, my system, my package or the robot_state_publisher node itself. My system works exac

2020-11-14 11:19:40 -0500 commented question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

At first, I was trying to understand the usage of joint_state_publisher and robot_state_publisher, so I investigated the

2020-11-13 16:25:37 -0500 received badge  Associate Editor (source)
2020-11-13 16:25:37 -0500 edited question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information? Ubuntu 18.04 ROS2 Eloquent C++ TF KDL URDF r

2020-11-13 14:32:46 -0500 asked a question ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information?

ROS2 Eloquent - KDL - How do I get 'live' (Global) Joint Axis information? Ubuntu 18.04 ROS2 Eloquent C++ TF KDL URDF r

2020-11-13 12:36:46 -0500 received badge  Notable Question (source)
2020-11-02 13:47:34 -0500 marked best answer ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly
  • Ubuntu 18.04
    • ROS2 Eloquent
    • TF
    • C++

My pipeline:

I have a robot which uses sensors to detect the rotation, extension of its joints. It has revolute, prismatic, and fixed joints in a URDF file. Yes, I realize that the link names may be confusing, but its not really relevant.

me@my_computer:~/ROS2_workspace/src/
return LaunchDescription([my_package/urdf_dir check_urdf my_robot.urdf   
robotname is: MyRobot
---------- Successfully Parsed XML --------------- root Link: base_link has 1 child(ren)
child(1):  0
    child(1):  1
        child(1):  3
            child(1):  4
                child(1):  5
                    child(1):  6
                        child(1):  7
                            child(1):  9
                                child(1):  10

I am gathering data from sensors and publishing that data with my node on a custom Msg interface.

  void publish_sensor_data
  {
return LaunchDescription([
    auto sensors_msg = std::make_unique<SensorsMsg>();
    /* magic */
    pub_for_sensors_->publish(std::move(sensors_msg));
  }

I then have a second node which takes my custom Msg and converts it to Msg::JointState

void sensors_callback(const SensorsMsg::SharedPtr sensors_msg){
  auto joint_state_msg = std::make_shared<sensor_msgs::msg::JointState>();
  joint_state_msg->name.push_back("revolute_joint_1");
  joint_state_msg->name.push_back("revolute_joint_2");
  joint_state_msg->name.push_back("prismatic_joint_1");
  joint_state_msg->name.push_back("revolute_joint_3");
  joint_state_msg->name.push_back("revolute_joint_4");
  joint_state_msg->name.push_back("revolute_joint_5");
  joint_state_msg->name.push_back("revolute_joint_6");
  joint_state_msg->name.push_back("prismatic_joint_2");
  joint_state_msg->name.push_back("fixed_joint");

  joint_state_msg->position.push_back( deg_to_rad(sensors_msg->angle));
  joint_state_msg->position.push_back( deg_to_rad(sensors_msg->angle));
  joint_state_msg->position.push_back( in_to_m( sensors_msg->extend));
  joint_state_msg->position.push_back( deg_to_rad(sensors_msg->angle));
  joint_state_msg->position.push_back( deg_to_rad(sensors_msg->angle));
  joint_state_msg->position.push_back( deg_to_rad(sensors_msg->angle));
  joint_state_msg->position.push_back( deg_to_rad(sensors_msg->angle));
  joint_state_msg->position.push_back( in_to_m( sensors_msg->extend));
  joint_state_msg->position.push_back( deg_to_rad(0.) );

  joint_state_msg->header.stamp = this->now();
  joint_state_pub_->publish(std::move(*joint_state_msg));  
}

I make use of robot_state_publisher to convert my Msg::JointState to send my transforms over the TF server. This is done through a launch file

import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():

urdf = os.path.join(get_package_share_directory('my_package'),'urdf_dir', 'my_robot.urdf')

config_common = os.path.join(get_package_share_directory('my_package'), 'yaml_dir', 'robot_params.yaml')                        

return LaunchDescription([
    Node(package='my_package', node_name='sensor_publisher', node_executable='sensor_publisher', name="sensor_publisher", output='screen', arguments=[config_common]),
    Node(package='my_package', node_executable='sensors_to_jointstates', output='screen', parameters=[config_common] ),
    Node(package='robot_state_publisher', node_executable='robot_state_publisher', output='screen', arguments=[urdf, config_common]),
    Node(package='rviz2', node_executable='rviz2', output='screen' )
])

My problem:

Although I can use ros2 topic echo /joint_states (image below, left) to see that my sensor data is coming in at the rate I expect (20 hz), subsequently turned into joint states, and finally turned into TFMessages, the values that are received using ros2 run tf2_ros tf2_echo base_link 10 20 (image below, right) will have somewhat regular freezes, where the header timestemp will hold the same value for the sec and nanosec, and the sensor values wont change either. This will clear up after a short moment (~2s), but will reappear shortly (~2s) after image description

There are a couple things to note about the image

  1. Both terminals are running at the same time, but the tf_echo command on the right has a timestamp far ahead of the ros2 topic echo on the left
  2. Both terminals/nodes respective sensor values react instantly/synchronously when the physical sensor changes position (not pictured), as long as the TF is in its active phase and regardless of the timestamp difference ...
(more)
2020-11-02 13:47:23 -0500 answered a question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

I haven't figured out the exact answer but I believe the problem is in my CMakeLists.txt. I built a new minimal project

2020-11-02 13:45:39 -0500 received badge  Popular Question (source)
2020-10-23 20:23:31 -0500 commented question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

I have created a minimal reproducible package and the issue has resolved. I will be doing more research and will update

2020-10-23 09:16:24 -0500 commented question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

The behavior on /tf is as expected, no freezes or anything. I have use_tf_static set to false, so the /tf_static topic d

2020-10-23 09:15:41 -0500 commented question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

The behavior on /tf is as expected, no freezes or anything. I have use_tf_static set to false, so the /tf_static topic d

2020-10-23 09:14:20 -0500 commented question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

The behavior on /tf is as expected, no freezes or anything. I have use_tf_static set to false, so the /tf_static topic d

2020-10-23 09:13:58 -0500 commented question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

The behavior on /tf is as expected, no freezes or anything. I have use_tf_static set to false, so the /tf_static' topic

2020-10-22 19:14:33 -0500 edited question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly Ubuntu 18.04 ROS2 Eloquent TF C++

2020-10-22 19:10:35 -0500 edited question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly Ubuntu 18.04 ROS2 Eloquent TF C++

2020-10-22 19:02:03 -0500 edited question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly Ubuntu 18.04 ROS2 Eloquent TF C++

2020-10-22 18:54:09 -0500 edited question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly Ubuntu 18.04 ROS2 Eloquent TF C++

2020-10-22 18:21:38 -0500 asked a question ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly

ROS2 Eloquent TF listener (tf_echo) values freeze/resume on a cycle unexpectedly Ubuntu 18.04 ROS2 Eloquent TF C++ M

2020-08-01 00:56:24 -0500 commented answer [ROS2] msg stamp time difference

bump. I would also like this comment answered

2020-03-10 07:07:49 -0500 received badge  Famous Question (source)
2020-03-10 07:07:49 -0500 received badge  Notable Question (source)
2019-04-24 11:23:46 -0500 marked best answer Getting hector_SLAM to work with Neato Lidar, tf issues?

First off, I understand that versions of this question have been asked before, but I have already scoured through ROS wiki, ROS answers, google, etc. and I'm still lost. I am brand new to Linux, and ROS, but have MUCH time to devote to learning this material.

I am running a fresh install of Ubuntu 16.04 and ROS Kinetic. My objective is to use the Neato Lidar and Hector SLAM to create a 2D map of our office. I have the Lidar running and it can create real-time maps on rviz, but I am having issues when trying to implement Hector SLAM. I think my problem stems from a tf issue. In order to get to this point, I used this tutorial: http://meetjanez.splet.arnes.si/2015/... . I had already completed everything to get the Lidar drivers running (as in the tutorial, but from the ROS source), and the tutorial was useful to help me understand how to get the SLAM installed. But, in the very last step when I launch the neato.launch file, I get a repeating error of

 lookupTransform base_footprint to laser timed out. Could not transform laser scan into base_frame

and a one-time error of

No transform between frames /map and /base_link available after 20.002796 seconds of waiting. This warning only prints once.

My launch files are as follows.. neato.launch :

<?xml version="1.0"?>

<launch>

  <!--<node pkg="xv_11_laser_driver" type="neato_laser_publisher" name="xv_11_node">
    <param name="port" value="/dev/ttyACM0"/>
    <param name="firmware_version" value="2"/>
    <param name="frame_id" value="laser"/>
  </node>-->


  <node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 10"/>

  <node pkg="tf" type="static_transform_publisher" name="base_frame_laser" args="0 0 0 0 0 0 /base_link /laser 10"/>


  <!--<node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>-->

  <include file="$(find hector_mapping)/launch/mapping_default.launch"/> 

  <node pkg="rviz" type="rviz" name="rviz" args="-d rviz_cfg.rviz"/>
  <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"/>
</launch>

mapping_default.launch ...

<?xml version="1.0"?>

<launch>
  <arg name="tf_map_scanmatch_transform_frame_name" default="/scanmatcher_frame"/>
  <arg name="base_frame" default="base_link"/>
  <arg name="odom_frame" default="base_link"/>
  <arg name="pub_map_odom_transform" default="true"/>
  <arg name="scan_subscriber_queue_size" default="5"/>
  <arg name="scan_topic" default="scan"/>
  <arg name="map_size" default="2048"/>

  <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

    <!-- Frame names -->
    <param name="map_frame" value="map" />
    <param name="base_frame" value="$(arg base_frame)" />
    <param name="odom_frame" value="$(arg base_frame)" />

    <!-- Tf use -->
    <param name="use_tf_scan_transformation" value="true"/>
    <param name="use_tf_pose_start_estimate" value="false"/>
    <param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

    <!-- Map size / start point -->
    <param name="map_resolution" value="0.050"/>
    <param name="map_size" value="$(arg map_size)"/>
    <param name="map_start_x" value="0.5"/>
    <param name="map_start_y" value="0.5" />
    <param name="map_multi_res_levels" value="2" />

    <!-- Map update parameters -->
    <param name="update_factor_free" value="0.4"/>
    <param name="update_factor_occupied" value="0.7" />    
    <param name="map_update_distance_thresh" value="0.2"/>
    <param name="map_update_angle_thresh" value="0.9" />
    <param name="laser_z_min_value" value = "-1.0" />
    <param name="laser_z_max_value" value = "1.0" />

    <!-- Advertising config --> 
    <param name ...
(more)
2019-03-05 09:33:31 -0500 marked best answer Dreaded linker error. Boost and catkin_make

Hey there, I am creating my own package with Boost, and I have a .cpp file that is able to compile using g++ with:

g++ newboost.cpp -o boost -lboost_system -lpthread

But, when I try to put the .cpp file into my package and catkin_make my package, I get the following error:

/usr/bin/ld: CMakeFiles/keyencelaser_node.dir/src/newboost.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
keyencelaser/CMakeFiles/keyencelaser_node.dir/build.make:95: recipe for target '/home/ateator/catkin_ws/devel/lib/keyencelaser/keyencelaser_node' failed
make[2]: *** [/home/ateator/catkin_ws/devel/lib/keyencelaser/keyencelaser_node] Error 1
CMakeFiles/Makefile2:4463: recipe for target 'keyencelaser/CMakeFiles/keyencelaser_node.dir/all' failed
make[1]: *** [keyencelaser/CMakeFiles/keyencelaser_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed

which is a similar error to the one I got before adding the flags onto the g++ terminal command

I have tried to add Boost into my CMakeLists.txt, but (although it did improve my errors), I am still left with the above errors. My CMakeLists.txt is:

find_package(catkin REQUIRED COMPONENTS
  roscpp

)
find_package(
  Boost
  REQUIRED COMPONENTS system thread
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)
 add_executable(keyencelaser_node src/newboost.cpp)
 target_link_libraries(keyencelaser_node
   ${Boost_FILESYSTEM_LIBRARIES}
   ${Boost_SYSTEM_LIBRARY}
 )

I am pretty sure it's a linker error but I don't know how to fix it. Again, the edits I made to my CMakeLists.txt eliminated a lot of "undefined reference to" errors, but now that those are gone, I am left with the above. I appreciate any and all help.

Thank you.

2019-03-05 09:33:31 -0500 received badge  Teacher (source)
2019-03-05 09:33:31 -0500 received badge  Self-Learner (source)
2019-01-11 07:02:19 -0500 received badge  Famous Question (source)
2018-03-10 06:19:36 -0500 received badge  Famous Question (source)
2018-03-10 06:19:36 -0500 received badge  Popular Question (source)
2018-03-10 06:19:36 -0500 received badge  Notable Question (source)
2018-02-28 20:13:16 -0500 marked best answer Can you please help with my hector mapping launch file?

I have a LaserScan node "keyencelaser" that is publishing on the topic "scan" with frame "laser_frame"

  ros::init(argc, argv, "keyencelaser_publisher");
  ros::NodeHandle n;
  ros::Publisher scan_pub = n.advertise<sensor_msgs::LaserScan>("scan", 50);
  (...)
  scan.header.frame_id = "laser_frame";

My launch file currently looks like:

<launch>


<node pkg="keyencelaser" type="keyencelaser_rosnode" name="keyencelaser" />
<node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_to_laser_link" args="0.0 0.0 0.0 0 0 0.0 /base_link /laser_frame 100"/>
<param name="pub_map_odom_transform" value="false"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="base_link" />
<param name="odom_frame" value="base_link" />
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
  <param name="use_tf_scan_transformation" value="true" />
  <param name="use_tf_pose_start_estimate" value="false" />
  <param name="map_resolution" value="0.050" />
  <param name="map_size" value="2048" />
  <param name="scan_subscriber_queue_size" value="5" />
  <param name="scan_topic" value="scan" />
  <param name="tf_map_scanmatch_transform_frame_name" value="scanmatcher_frame" />
</node>
</launch>

But I throw this error once I use my launch file:

[ INFO] [1482419456.331809455]: lookupTransform base_link to laser_frame timed out. Could not transform laser scan into base_frame.
Check failed in file /usr/include/boost/numeric/ublas/matrix_expression.hpp at line 2007:
size1 == size2
terminate called after throwing an instance of 'boost::numeric::ublas::bad_argument'
  what():  bad argument

Can someone please help me figure this out? I have tried multiple combinations but can't quite get it.

2018-01-11 01:28:20 -0500 marked best answer How do I get the transformed point cloud from in callback? I'm not getting a rotated cloud in my CB

Hello everyone,

I have a hardware setup which consists of a Keyence SZ-V LiDAR and a Razor 9-DOF IMU. There is no real robot, I just have the two sensors somewhat attached so that I can move them at the same time with one motion. I wrote my own first laser driver node to poll the laser and produce a sensor_msgs::LaserScan with the frame_id as "base_link". No issue there. I then have a second node which uses message_filters::Synchronizer to tf transform the LaserScan into a 3D sensor_msgs::PointCloud2 that is rotated by the IMU orientation with frame_id "laser_link". No issue there. I then have a third node which listens for these sensor_msgs::PointCloud2, converts them to pcl::PointCloud2, adds 20 of them, converts them back to sensor_msgs::PointCloud2 and then publishes that larger point cloud.

Here is the issue: because the rotation is caused by a tf transform, the rotation is not seen in the combined cloud when I move the IMU. If I turn the laser alone, the combined cloud is as expected and shows some old points as well as the changed ones (not rotated). If I turn the IMU alone, the rotation is seen in the second node (Laser+IMU) but in the third node I just see a something that looks like my 20 scans stacked on top of each other, but rotated by the IMU orientation. I would expect to see several clouds at intermittent positions between the start and end rotation positions.

I have tried changing the frame_id of this combined cloud to both "base_link" and "laser link" to see if I could grab the rotated cloud when combining the clouds, but neither of these worked. I mean, this error makes sense because I'm never really getting the rotated values into my third node. How do I correctly get these transformed clouds into my third node so that I can collect several clouds together whether the changes are seen in either the LaserScan or IMU?

EDIT: Better late than never.. my objective with this combined 3D point cloud is to get a 3D SLAM going. I'm aiming for ethzasl_icp_mapper as my SLAM algo but it seems that it needs more than just single scans as an input. That's why I'm trying to produce a larger cloud. I want to give it more points to extract data from. I've also looked at loam_back_and_forth but since it's now commercial that's out. I've also looked at BLAM! but there was so many issues trying to get it and it's dependencies installed that I gave up. I forgot the exact errors there....

2018-01-11 01:05:05 -0500 received badge  Notable Question (source)