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

Attribute error: type object 'type' has no attribute '_TYPE_SUPPORT'

asked 2021-06-24 07:26:16 -0500

maxunm gravatar image

This is the main portion of the error I am getting,

AttributeError: type object 'type' has no attribute '_TYPE_SUPPORT' This might be a ROS 1 message type but it should be a ROS 2 message type. Make sure to source your ROS 2 workspace after your ROS 1 workspace.

Here is my full traceback,

Traceback (most recent call last):
File "/home/mrumel/fisher_agc/AGCROS/install/server/lib/server/where_go", line 11, in <module>
load_entry_point('server==0.0.0', 'console_scripts', 'where_go')()
File "/home/mrumel/fisher_agc/AGCROS/install/server/lib/python3.8/site-packages/server/where_go.py", line 30, in main
where_go = WhereGo()
File "/home/mrumel/fisher_agc/AGCROS/install/server/lib/python3.8/site-packages/server/where_go.py", line 12, in __init__
self.srv = self.create_service(WhereGo, 'get_destination', self.where_go_callback)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py", line 1295, in create_service
check_for_type_support(srv_type)
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/type_support.py", line 20, in check_for_type_support
ts = msg_type.__class__._TYPE_SUPPORT
AttributeError: type object 'type' has no attribute '_TYPE_SUPPORT' This might be a ROS 1 message type but it should be a ROS 2 message type. Make sure to source your ROS 2 workspace after your ROS 1 workspace.

I don't have ROS1 installed on this machine at all so I do not know why It may be suggesting that that is the issue.

Here is my Environment variables,

ROS_VERSION=2
SESSION_MANAGER=local/ROS-Host-Test:@/tmp/.ICE-unix/1687,unix/ROS-Host-Test:/tmp/.ICE-unix/1687
ROS_PYTHON_VERSION=3
PWD=/home/mrumel/fisher_agc/AGCROS
AMENT_PREFIX_PATH=/home/mrumel/fisher_agc/AGCROS/install/station:/home/mrumel/fisher_agc/AGCROS/install/server:/home/mrumel/fisher_agc/AGCROS/install/mach2api:/home/mrumel/fisher_agc/AGCROS/install/agc_interfaces:/home/mrumel/fisher_agc/AGCROS/install/AGC:/opt/ros/foxy
CMAKE_PREFIX_PATH=/home/mrumel/fisher_agc/AGCROS/install/agc_interfaces
COLCON_PREFIX_PATH=/home/mrumel/fisher_agc/AGCROS/install
PYTHONPATH=/home/mrumel/fisher_agc/AGCROS/install/station/lib/python3.8/site-packages:/home/mrumel/fisher_agc/AGCROS/install/server/lib/python3.8/site-packages:/home/mrumel/fisher_agc/AGCROS/install/mach2api/lib/python3.8/site-packages:/home/mrumel/fisher_agc/AGCROS/install/agc_interfaces/lib/python3.8/site-packages:/home/mrumel/fisher_agc/AGCROS/install/AGC/lib/python3.8/site-packages:/opt/ros/foxy/lib/python3.8/site-packages
LD_LIBRARY_PATH=/home/mrumel/fisher_agc/AGCROS/install/agc_interfaces/lib:/opt/ros/foxy/opt/yaml_cpp_vendor/lib:/opt/ros/foxy/opt/rviz_ogre_vendor/lib:/opt/ros/foxy/lib/x86_64-linux-gnu:/opt/ros/foxy/lib
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=foxy
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-06-24 08:45:28 -0500

maxunm gravatar image

I will be adding this answer here for anyone who has this issue in the future...

It seems that colcon/ros didn't like the name I had used for my .srv file (WhereGo) and I rebased it to GetDestination and it all magically fixed itself it seems.

edit flag offensive delete link more

Comments

I had a similar error with an action client. My (unthinking) mistake was in passing the action type as its name rather than the type (i.e., cli = ActionClient(node, 'example/action/Fibonacci', 'fibonacci') when it should have been cli = ActionClient(node, Fibonacci, 'fibonacci')).

kramer gravatar image kramer  ( 2022-06-23 22:15:24 -0500 )edit

Same... I renamed my srv file to 'Oec.srv' from 'OddEvenCheck,srv' and ros ran its abraCaDabra.... weird....

Tempest gravatar image Tempest  ( 2022-08-09 02:43:10 -0500 )edit

Question Tools

Stats

Asked: 2021-06-24 07:26:16 -0500

Seen: 3,265 times

Last updated: Jun 24 '21