uwgraphics / relaxed_ik_ros1

Public Repository for the Wrappers for ROS1 for RelaxedIK
MIT License
18 stars 18 forks source link

error in rviz_viewer.py #3

Open JCampbell9 opened 2 years ago

JCampbell9 commented 2 years ago

Hey, when running roslaunch relaxed_ik_ros1 rviz_viewer.launch I get the TypeError as seen below, killing the rviz window. (BTW I'm using python 2.7.17) Edit: Also I'm using ros melodic on ubuntu 18.04 (via wslg)

image

SimonQi1 commented 2 years ago

Hey, when running roslaunch relaxed_ik_ros1 rviz_viewer.launch I get the TypeError as seen below, killing the rviz window. (BTW I'm using python 2.7.17)

image

I have the same problem with you, I think that the vision of python is the root of the problem, but if I change the vision to python3, then the pykdl will error.

JCampbell9 commented 2 years ago

So this problem seems to be caused by the line ~311 exec(joint_state_define) which changes joint_state_define from type str to type function. This then throws the error of trying to combine a function and str in line 379 exec(joint_state_define + "\njs = joint_state_define(x)", globals(), loc) because joint_state_define is now of type function.

My quick fix is to make a duplicate variable of joint_state_define (I used joint_state_define2) before line 311 and used the duplicate variable ( joint_state_define2) for line 379.

pragathip commented 2 years ago

I think line 311 can be commented out. It does not seem to serve any purpose.