view_frame.py can not receive the tf_static
I'm using dashing ubuntu 18.04 with robot_state_publisher on jetson nano
I've written a launch file to publish tf and tf_static by loading a urdf file through robot_state_publisher
and joint_state_publisher
node.
I can see the data by
ros2 topic echo /tf
and
ros2 topic echo /tf_static
But I can neither see the tf_static in view_frame.py nor lookup_transform function
For example. here are the transforms of base_footprint
to base_link
and base_link
to imu_link
The strange thing is I can't see the static tf in the tf tree,
and I cannot see the static tf through lookup_transformation.
Traceback (most recent call last):
...
tf2.LookupException: "base_foorprint" passed to lookupTransform argument target_frame does not exist.
If necessary:
Here is my launch file
import os
import sys
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription, LaunchService
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition, UnlessCondition
def generate_launch_description():
urdf_file = os.path.join(get_package_share_directory('tianracer_description'), \
'urdf/tianracer_compact.urdf')
gui = LaunchConfiguration('gui', default=False)
use_rviz = LaunchConfiguration('use_rviz', default=False)
return LaunchDescription([
DeclareLaunchArgument(
name='gui',
default_value="False",
description="Flag to enable joint_state_publisher_gui"
),
DeclareLaunchArgument(
name='use_rviz',
default_value="False",
description="Flag to enable rviz"
),
Node(
package='robot_state_publisher',
node_executable='robot_state_publisher',
node_name='robot_state_publisher',
output='screen',
arguments=[urdf_file],
parameters=[{"publish_frequency": 20.0}]
),
Node(
condition=UnlessCondition(gui),
package='joint_state_publisher',
node_executable='joint_state_publisher',
node_name='joint_state_publisher',
output='screen',
arguments=[urdf_file]
),
Node(
condition=IfCondition(gui),
package='joint_state_publisher_gui',
node_executable='joint_state_publisher_gui',
node_name='joint_state_publisher_gui',
output='screen',
),
Node(
condition=IfCondition(use_rviz),
package="rviz2",
node_executable="rviz2",
node_name="rviz2",
output="screen",
)
])
Any help is appreciated!
It looks like a syntax error:
tf2.LookupException: "base_foorprint" passed to lookupTransform argument target_frame does not exist
. it should bebase_footprint
vsbase_foorprint
Thanks for your careful inspection. But it is indeed not for this reason. Because the view_frame.py can't receive static tf either
This is the new log after I fix the typo
Could not find a connection between 'base_link' and 'base_footprint' because they are not part of the same tree.Tf has two or more unconnected trees.
It comes from my test code
Please take a look at previous question