joshnewans / urdf_example

A simple example of a URDF file to use with ROS
71 stars 40 forks source link

ModelNotFoundError: No Module named xacro #1

Open Vasanth28897 opened 2 years ago

Vasanth28897 commented 2 years ago

Hi, When i try to run the "ros2 launch urdf_example rsp.launch.py" it executes the error like this "raise InvalidLaunchFileError(extension, likely-errors=exceptions) launch.invalidlaunch_file_error.InvalidLaunchFileError : Caught exception when trying to load file of format [py]: No module named 'xacro'.". Don't know how to rectify this.

Thanks in Advance.

joshnewans commented 2 years ago

Hey, sorry I haven't responded to your other issue yet, it's been on my to do list (have you had any luck with it?)

For this one, you probably need to run sudo apt install ros-foxy-xacro (or if not using foxy, whatever ROS distro you have. I think this was mentioned in one of the videos somewhere but it's definitely easy to miss :)

Vasanth28897 commented 2 years ago

Hey, This is the other issue that i mailed you about, still hanging with.

Hi, I want to clarify some other information from the video you named "Drive your Virtual Robot". I wrote a custom robot(has a chassis and 4 wheels) in the urdf file, added all the files that need to run the bot in gazebo, I used rqt_robot_steering node used to drive the bot. It works perfectly. I tried to use the teleop_twist_keyboard, like you did in that video in "Keyboard Teleop" to control the bot from the keyboard. But it shows like this "Waiting for subscriber to connect to /cmd_vel" . By the way, I used ROS1. I don't know what to do. Thanks in advance.

And also I am using ROS2 now, this is the new issue that i am working on, likewise the xacro. I will try your solution. I installed joint_state_publisher_gui in ros-foxy. After i run 'ros2 run joint_state_publisher_gui joint_state_publisher_gui" it shows No executable command. Thanks in Advnace.

Regards K.S.Vasanth

On Fri, Mar 25, 2022 at 1:32 PM Josh Newans @.***> wrote:

Hey, sorry I haven't responded to your other issue yet, it's been on my to do list (have you had any luck with it?)

For this one, you probably need to run sudo apt install ros-foxy-xacro (or if not using foxy, whatever ROS distro you have. I think this was mentioned in one of the videos somewhere but it's definitely easy to miss :)

— Reply to this email directly, view it on GitHub https://github.com/joshnewans/urdf_example/issues/1#issuecomment-1078755513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLQSUGDFEYUZEBFS24BKB3VBVXHPANCNFSM5RTKYGBQ . You are receiving this because you authored the thread.Message ID: @.***>

joshnewans commented 2 years ago

So regarding the first issue, are you saying that you have it currently working in Gazebo, control works using rqt_robot_steering, but teleop_twist_keyboard is reporting Waiting for subscriber to connect to /cmd_vel? And this is all definitely running under ROS 2 now? That is very odd indeed.

The first thing I would suggest is to open a second terminal and run ros2 topic echo /cmd_vel then start pressing the keys in the teleop window to see whether anything is coming through. Beyond that I'm not sure so maybe report back once you've tried that and we'll see if we can figure it out.

Regarding the second issue (joint_state_publisher_gui not running), that's also a quite strange. Is the error literally No executable command? I've just not seen that as an output before. I'd try first closing and reopening your terminal, ensuring you've sourced your ROS installation (and only ROS 2, not ROS 1 - maybe check your bashrc?) and if it still isn't working, copy-paste the exact output here.