xArm-Developer / xarm_ros

ROS packages for robotic products from UFACTORY
https://www.ufactory.cc/
BSD 3-Clause "New" or "Revised" License
196 stars 147 forks source link

Xarm simulation in gazebo not working #198

Closed HoteSaing closed 11 months ago

HoteSaing commented 11 months ago

Hi, I have been trying to run gazebo simulation on xarm according to the official guide here: https://github.com/xArm-Developer/xarm_ros. However, after running the simulation for a few seconds the manipulator just falls to the ground and I cannot do anything about it. It would be much appreciated if you could help me. Here is my error message:

$ roslaunch xarm_gazebo xarm7_beside_table.launch ... logging to /home/lyb/.ros/log/e59d946c-3777-11ee-9446-f147a27eb3fa/roslaunch-lyb-2666363.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

xacro: in-order processing became default in ROS Melodic. You can drop the option. Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead. started roslaunch server http://lyb:36797/

SUMMARY

PARAMETERS

NODES / gazebo (gazebo_ros/gzserver) gazebo_gui (gazebo_ros/gzclient) robot_state_publisher (robot_state_publisher/robot_state_publisher) spawn_gazebo_model (gazebo_ros/spawn_model) /xarm/ traj_controller_spawner (controller_manager/controller_manager)

auto-starting new master process[master]: started with pid [2666446] ROS_MASTER_URI=http://localhost:11311

setting /run_id to e59d946c-3777-11ee-9446-f147a27eb3fa process[rosout-1]: started with pid [2666506] started core service [/rosout] process[gazebo-2]: started with pid [2666513] process[gazebo_gui-3]: started with pid [2666517] process[spawn_gazebo_model-4]: started with pid [2666523] process[xarm/traj_controller_spawner-5]: started with pid [2666524] /usr/bin/env: ‘python’: No such file or directory process[robot_state_publisher-6]: started with pid [2666525] [xarm/traj_controller_spawner-5] process has died [pid 2666524, exit code 127, cmd /home/lyb/catkin_ws/src/ros_control/controller_manager/scripts/controller_manager spawn xarm7_traj_controller joint_state_controller name:=traj_controller_spawner log:=/home/lyb/.ros/log/e59d946c-3777-11ee-9446-f147a27eb3fa/xarm-traj_controller_spawner-5.log]. log file: /home/lyb/.ros/log/e59d946c-3777-11ee-9446-f147a27eb3fa/xarm-traj_controller_spawner-5*.log SpawnModel script started [INFO] [1691669859.720464, 0.000000]: Loading model XML from ros parameter [INFO] [1691669859.721568, 0.000000]: Waiting for service /gazebo/spawn_urdf_model [ INFO] [1691669859.744580924]: Finished loading Gazebo ROS API Plugin. [ INFO] [1691669859.744855696]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... Warning [parser.cc:833] XML Attribute[update_rate] in element[physics] not defined in SDF, ignoring. [ INFO] [1691669859.968192870, 0.002000000]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1691669859.976660927, 0.010000000]: Physics dynamic reconfigure ready. [INFO] [1691669860.025607, 0.057000]: Calling service /gazebo/spawn_urdf_model [INFO] [1691669860.198109, 0.173000]: Spawn status: SpawnModel: Successfully spawned entity [ INFO] [1691669860.228283340, 0.173000000]: Loading gazebo_ros_control plugin [ INFO] [1691669860.228402253, 0.173000000]: Starting gazebo_ros_control plugin in namespace: /xarm [ INFO] [1691669860.228734254, 0.173000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server. [ERROR] [1691669860.355144719, 0.173000000]: Did not find PID configuration for joint 'joint1'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ERROR] [1691669860.355426097, 0.173000000]: Did not find PID configuration for joint 'joint2'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ERROR] [1691669860.355538144, 0.173000000]: Did not find PID configuration for joint 'joint3'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ERROR] [1691669860.355631218, 0.173000000]: Did not find PID configuration for joint 'joint4'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ERROR] [1691669860.355718136, 0.173000000]: Did not find PID configuration for joint 'joint5'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ERROR] [1691669860.355803253, 0.173000000]: Did not find PID configuration for joint 'joint6'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ERROR] [1691669860.356020510, 0.173000000]: Did not find PID configuration for joint 'joint7'. Commands from 'hardware_interface::PositionJointInterface' will bypass dynamics. [ INFO] [1691669860.356235199, 0.173000000]: Joint mode switching is enabled [ INFO] [1691669860.361156587, 0.173000000]: Loaded gazebo_ros_control.

[spawn_gazebo_model-4] process has finished cleanly log file: /home/lyb/.ros/log/e59d946c-3777-11ee-9446-f147a27eb3fa/spawn_gazebo_model-4*.log ../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available.

Screenshot 2023-08-10 203412

penglongxiang commented 11 months ago

Hi, according to the output:

/usr/bin/env: ‘python’: No such file or directory
process[robot_state_publisher-6]: started with pid [2666525]
[xarm/traj_controller_spawner-5] process has died [pid 2666524, exit code 127, cmd /home/lyb/catkin_ws/src/ros_control/controller_manager/scripts/controller_manager spawn xarm7_traj_controller joint_state_controller __name:=traj_controller_spawner __log:=/home/lyb/.ros/log/e59d946c-3777-11ee-9446-f147a27eb3fa/xarm-traj_controller_spawner-5.log].

Have you properly installed python? In order to make sure the proper execution, please also make sure you have installed everything mentioned in readme Chapter 3.

HoteSaing commented 11 months ago

Hi, I have solved my issue. I found out that there are ros-control and ros-controllers packages installed in my another workspace (catkin_ws) and it is somehow effecting my program in this workspace (xarm_ws). Seems like the program, by default, checks for the packages in the catkin_ws first and only after that it checks the package in /opt/ros directory. I removed those packages from catkin_ws and the problem is solved.