robot_state_visualize - no transform rviz error
Hello everyone,
I have a question regarding the use of the robotstatevisualize launch file, provided by the ros industrial packages. Any help or and or feedback is greatly appreciated, thanks in advance!
My Setup:
I have a single Windows PC running Roboguide and a Linux Ubuntu VM. I am using the Fanuc M20IA35m Robot.
My Goal:
I want to use ROS to do trajectory planning around obstacles.
My Problem:
Since the M20IA35m Robot is not officially supported, I created my own moveit_configuration.
- Autogenerated demo.launch file - works
- Fanuc_driver in roboguide and connection to Linux system - works
The next step for me was to test the provided launch files from the fanuc repository on github. I adapted them to my robot by changing the names in the files according to my moveit config.
The interfacestreaming.launch and the test.launch files work without issues. The robotstate_visualizer does not work. More concrete, Rviz does not have transforms for the joints. The model is not correctly loaded and every link appears in white and centers in the screen.
For every link I get:
No transform from [robotbase] to [link1]
The solution from this and this threat (adding a joint state publisher) did not fix my problem. Also a point of confusion for me is that the joint state publisher is not a part of the interface streaming launch file, which works fine for me.
Here is the code of the robotstatevisualize launch file:
<launch>
<arg name="robot_ip" doc="IP of controller" />
<arg name="J23_factor" default="1" doc="Compensation factor for joint 2-3 coupling (-1, 0 or 1)" />
<arg name="use_bswap" default="true" doc="If true, robot driver will byte-swap all incoming and outgoing data" />
<rosparam command="load" file="$(find fanuc_m20ia35m_moveit_config)/config/joint_names_m20ia35m.yaml" />
<include file="$(find fanuc_driver)/launch/robot_state.launch">
<arg name="robot_ip" value="$(arg robot_ip)" />
<arg name="J23_factor" value="$(arg J23_factor)" />
<arg name="use_bswap" value="$(arg use_bswap)" />
</include>
<node name="robot_state_publisher" pkg="robot_state_publisher"
type="robot_state_publisher" />
<include file="$(find fanuc_m20ia35m_moveit_config)/launch/custom/load_m20ia.launch" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find industrial_robot_client)/config/robot_state_visualize.rviz" required="true" />
</launch>
Further questions:
-> Moved to a new threat.
Edit:
For reference, here is my top level xacro file:
<?xml version="1.0" ?>
<robot name="fanuc_m20ia35m" xmlns:xacro="http://wiki.ros.org/xacro">
<!-- include macros for M-20iA35m and the eef model -->
<xacro:include filename="./m20ia35m_macro.xacro"/>
<xacro:include filename="./eef_description_macro.xacro"/>
<!-- create the robot + eef combo itself as a macro -->
<xacro:macro name="fanuc_m20ia35m_with_eef" params="prefix">
<!-- instantiate M-20iA35m and eef model -->
<xacro:fanuc_m20ia35m prefix="${prefix}robot_" />
<xacro:eef_description prefix="${prefix}eef_" />
<!-- attach eef to M-20iA35m model -->
<!-- Note: this assumes that the 'my_eef' macro defines a 'base_link' link which is the start of it's kinematic chain (if any) -->
<joint name="${prefix}robot_flange-${prefix}eef_base_link_gripper" type="fixed">
<origin xyz="0 0 0" rpy="0 ${-0.5*pi} 0"/>
<parent link="${prefix}robot_flange" />
<child link="${prefix}eef_base_link_gripper" />
</joint>
</xacro:macro>
<xacro:fanuc_m20ia35m_with_eef prefix=""/>
</robot>
Thanks so much for any answer in advance.
Have a great day!
Asked by cpetersmeier on 2019-06-26 06:42:35 UTC
Answers
After taking a look at your files I believe the problem is the names you've chosen for the joint
s in the m20ia35m_macro.xacro
file:
<joint name="${prefix}joint_1__base_link_link_1" type="revolute">
...
</joint>
joint_1__base_link_link_1
is a valid joint name, but if you use non-standard joint names, you'll have to make sure you list those same names in the joint_names_m20ia35m.yaml
. Otherwise the robot_state_publisher
can't match the incoming JointState
messages with the joint
s in your urdf.
I would strongly suggest to use the standard joint names joint_N
where N <- [1, ..]
(ie: just number them in natural order: joint_1
, joint_2
, etc). Unless you have very strong reasons not to do so, in that case you'd have to change the names in joint_names_m20ia35m.yaml
.
Edit: some general other comments:
- just place your
m20ia35m_macro.xacro
andm20ia35m.xacro
in thefanuc_m20ia_support
package. I'm not sure why you're using a separate package to host it - don't place files that are shared among other instances of M-20iA/35m in the MoveIt package. Specifically: place the joint names
.yaml
file in the support package - use different meshes for
visual
andcollision
geometry: at the very least, subsample your currentvisual
geometry so it gets less detailed. Collision checkers work much better with less detailed files - the
base_link
mesh has a strange origin right now (bothlink
andjoint
), I'd suggest to fix that - I would also suggest to use better naming for your tool frames. Refer to Coordinate Frames for Serial Industrial Manipulators - Application-Specific Tool Frames for some thoughts on that
- use standard names for everything:
manipulator
for thegroup
in your.srdf
, the packages and the files. It will help you significantly, both for contributing and for integrating with code and examples already 'out there' - use the trac_ik IK solver instead of KDL
Asked by gvdhoorn on 2019-06-27 10:09:58 UTC
Comments
Thank you for the fix. Unfortunately this did not fix the error, but since my goal is trajectory planning I am now working with the trajectory_execution.launch file, which works just fine.
I will also take a look at your general other comments section. I appreciate the help!
Asked by cpetersmeier on 2019-07-03 02:26:01 UTC
If this launch file doesn't work, I'd question the correctness of your setup.
re: trajectory_execution.launch
: that is an internal MoveIt file, you cannot "work" with that directly.
Asked by gvdhoorn on 2019-07-03 08:19:33 UTC
Comments
Seeing as you're German: are you using a German locale in your Ubuntu? What is the output of
echo $LC_NUMERIC
?This could be #q272692.
As to your other questions: please don't include multiple questions in a single post. It doesn't work very well with Askbot (which is what the underlying software is of ROS Answers).
Also: how are you starting that launch file? Which arguments do you pass it?
Asked by gvdhoorn on 2019-06-26 06:47:51 UTC
The output of
echo $LC_NUMERIC
is empty.Asked by cpetersmeier on 2019-06-26 06:52:38 UTC
I am starting the launch file this way:
Asked by cpetersmeier on 2019-06-26 06:53:17 UTC
The error you mention essentially means that
robot_state_publisher
is not publishing any TF frames. That typically happens if it doesn't receive anyJointState
messages.What is the output of
rostopic echo -n1 /joint_states
after you've started the launch file?LC_NUMERIC
being empty is unexpected. What is your systems locale configured as? German or English?Additionally: those
.launch
files are supposed to be hosted by robot support packages (ie:fanuc_m20ia_support
) not the MoveIt configuration packages.Asked by gvdhoorn on 2019-06-26 06:58:44 UTC
no need to get all hostile ;)
Asked by gvdhoorn on 2019-06-26 07:04:20 UTC
The output of
rostopic echo -n1 /joint_states
is:When I run
$ locale
I get this output:Asked by cpetersmeier on 2019-06-26 07:08:09 UTC
I'm slightly confused:
and:
that doesn't add up.
In any case, this does not appear to be a problem with a German locale.
So joint states are being published.
What is the currently configured
Fixed Frame
in RViz? Is that the root of your robot's model?Asked by gvdhoorn on 2019-06-26 07:10:27 UTC
Wasnt meant hostile! I am sorry if that came across this way. I thought I might just follow the guidelines and reedit my post. I very much appreciate the help :)
Asked by cpetersmeier on 2019-06-26 07:11:04 UTC
It was a bit of a joke: you wrote
threat
instead ofthread
.Asked by gvdhoorn on 2019-06-26 07:18:26 UTC
Yeah, I wondered with the locale too when I posted the answer.
I have the base_link as a fixed frame. In rviz it tells me: "Fixed Frame [base_link] does not exist". When I change it to for example (robot is the prefix here) [robot_base] or [robot_base_link], the base of the robot gets visible and correctly displayed, while all the other links are still in white and in the middle.
Update In the xacro, my "base_link" (the gripper consists out of multiple parts with a base) and the roboter "base_link" where named the same. I changed the gripepr one to base_link_gripper. The change did not affect the problem though, because prefixed are used for distinction anyway I think.
Asked by cpetersmeier on 2019-06-26 07:24:08 UTC
I think we're going to need to see your xacro and setup in more detail. Right now it seems like things should work, so I can't suggest anything until I get a better understanding of your setup.
Asked by gvdhoorn on 2019-06-26 08:38:52 UTC
Setup: In my workspace I have two packages:
Asked by cpetersmeier on 2019-06-27 01:39:11 UTC
Please edit this into your original question. Comments are too small.
Asked by gvdhoorn on 2019-06-27 02:29:46 UTC
Is this really a copy-paste of your top-level
.xacro
? There appears to be a duplication:The easiest way for me to help you would be if you could make your
.xacros
available.The M-20iA/35m you could just push to a fork of
ros-industrial/fanuc
. That would allow me to check them.As you don't want to share your gripper, perhaps you can make that available some other way.
Your problems are either due to a problem with your xacros, or with the configuration of RViz.
One thing you could do, regardless of whether you share anything, would be to show what the TF tree looks like. Run
rosrun rqt_tf_tree rqt_tf_tree
and post a screenshot (add it to the question).Asked by gvdhoorn on 2019-06-27 02:49:31 UTC
Additionally: I would recommend to debug the situation with the regular top-level
.xacro
file (ie: without your gripper). That is what therobot_state_visualize.launch
file is for, after all.If that does work correctly, the problem would be with your own custom
.xacro
.Asked by gvdhoorn on 2019-06-27 03:08:12 UTC
I checked the situation with the original top level xacro. Since the error is the same, I am gonna leave out the gripper from now on
Asked by cpetersmeier on 2019-06-27 03:43:51 UTC
Then please make all your files available somewhere. Preferably in a fork of
ros-industrial/fanuc
so I can easily see what you added/changed.Asked by gvdhoorn on 2019-06-27 03:46:13 UTC
I added the files on github and sent a contribution invite!
Asked by cpetersmeier on 2019-06-27 09:16:39 UTC