jkaniuka / magician_ros2

ROS 2 control stack for Dobot Magician educational manipulator.
MIT License
34 stars 11 forks source link

when i am tries to run code of launch #2

Closed DearMoeurn12 closed 11 months ago

DearMoeurn12 commented 11 months ago

i am already connect to dobot and config it to appear green light

Run

ros2 launch dobot_bringup dobot_magician_control_system.launch.py

Error

[INFO] [launch.user]: Loading tool parameters. [set_tool_null-1] [WARN] Dobot Magician is not connected. [ERROR] [set_tool_null-1]: process has died [pid 45099, exit code 1, cmd '/home/dear/dev_ws/install/dobot_bringup/lib/dobot_bringup/set_tool_null --ros-args'].

jkaniuka commented 11 months ago

Hi, check the name of the serial port the robot is connected to and eventually modify it in dobot_handle.py script in dobot_driver package :wink:

DearMoeurn12 commented 11 months ago

I already check the port and i still got the same error

Error

[INFO] [launch]: All log files can be found below /home/dear/.ros/log/2023-10-17-09-57-18-698313-Dear-Nx-Gen-8642 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [set_tool_null-1]: process started with pid [8648] [INFO] [launch.user]: Loading tool parameters. [set_tool_null-1] [WARN] Dobot Magician is not connected. [ERROR] [set_tool_null-1]: process has died [pid 8648, exit code 1, cmd '/home/dear/dev_ws/install/dobot_bringup/lib/dobot_bringup/set_tool_null --ros-args']. [INFO] [ros2 launch dobot_diagnostics alarms_analyzer.launch.py-2]: process started with pid [8652] [INFO] [launch.user]: Starting the diagnostics module. [INFO] [gripper_server-3]: process started with pid [8655] [INFO] [launch.user]: Gripper control service started. [INFO] [suction_cup_server-4]: process started with pid [8657] [INFO] [launch.user]: Suction Cup control service started. [gripper_server-3] [WARN] Dobot Magician is not connected. [suction_cup_server-4] [WARN] Dobot Magician is not connected. [ERROR] [gripper_server-3]: process has died [pid 8655, exit code 1, cmd '/home/dear/dev_ws/install/dobot_end_effector/lib/dobot_end_effector/gripper_server --ros-args']. [ERROR] [suction_cup_server-4]: process has died [pid 8657, exit code 1, cmd '/home/dear/dev_ws/install/dobot_end_effector/lib/dobot_end_effector/suction_cup_server --ros-args']. [INFO] [ros2 launch dobot_homing dobot_homing.launch.py-5]: process started with pid [8681] [INFO] [launch.user]: Starting homing service. [INFO] [launch.user]: Loading homing parameters. [ros2 launch dobot_homing dobot_homing.launch.py-5] [INFO] [launch]: All log files can be found below /home/dear/.ros/log/2023-10-17-09-57-21-896166-Dear-Nx-Gen-8683 [ros2 launch dobot_homing dobot_homing.launch.py-5] [INFO] [launch]: Default logging verbosity is set to INFO [ros2 launch dobot_homing dobot_homing.launch.py-5] [INFO] [homing_server-1]: process started with pid [8684] [ros2 launch dobot_homing dobot_homing.launch.py-5] [INFO] [homing_params.yaml-2]: process started with pid [8686] [ros2 launch dobot_homing dobot_homing.launch.py-5] [homing_server-1] [WARN] Dobot Magician is not connected. [ros2 launch dobot_homing dobot_homing.launch.py-5] [ERROR] [homing_server-1]: process has died [pid 8684, exit code 1, cmd '/home/dear/dev_ws/install/dobot_homing/lib/dobot_homing/homing_server --ros-args']. [INFO] [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6]: process started with pid [8692] [INFO] [launch.user]: Strating trajectory validator service. [INFO] [launch.user]: Loading kinematics parameters. [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6] [INFO] [launch]: All log files can be found below /home/dear/.ros/log/2023-10-17-09-57-23-898870-Dear-Nx-Gen-8694 [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6] [INFO] [launch]: Default logging verbosity is set to INFO [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6] [INFO] [trajectory_validator_server-1]: process started with pid [8695] [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6] [INFO] [axis_limits.yaml-2]: process started with pid [8697] [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6] [trajectory_validator_server-1] pybullet build time: Oct 11 2023 16:42:09 [INFO] [ros2 launch dobot_motion dobot_PTP.launch.py-7]: process started with pid [8710] [INFO] [launch.user]: Starting PointToPoint action server. [INFO] [launch.user]: Setting speed and acceleration values. [ros2 launch dobot_motion dobot_PTP.launch.py-7] [INFO] [launch]: All log files can be found below /home/dear/.ros/log/2023-10-17-09-57-25-893479-Dear-Nx-Gen-8712 [ros2 launch dobot_motion dobot_PTP.launch.py-7] [INFO] [launch]: Default logging verbosity is set to INFO [ros2 launch dobot_motion dobot_PTP.launch.py-7] [INFO] [PTP_server-1]: process started with pid [8713] [ros2 launch dobot_motion dobot_PTP.launch.py-7] [INFO] [PTP_motion_params.yaml-2]: process started with pid [8715] [ros2 launch dobot_motion dobot_PTP.launch.py-7] [PTP_server-1] [WARN] Dobot Magician is not connected. [ros2 launch dobot_motion dobot_PTP.launch.py-7] [ERROR] [PTP_server-1]: process has died [pid 8713, exit code 1, cmd '/home/dear/dev_ws/install/dobot_motion/lib/dobot_motion/PTP_server --ros-args']. [ros2 launch dobot_homing dobot_homing.launch.py-5] [homing_params.yaml-2] Node not found [ros2 launch dobot_homing dobot_homing.launch.py-5] [ERROR] [homing_params.yaml-2]: process has died [pid 8686, exit code 1, cmd 'sleep 5;ros2 param load /dobot_homing_srv /home/dear/dev_ws/install/dobot_homing/share/dobot_homing/config/homing_params.yaml']. [INFO] [ros2 launch dobot_homing dobot_homing.launch.py-5]: process has finished cleanly [pid 8681] [ros2 launch dobot_kinematics dobot_validate_trajectory.launch.py-6] [INFO] [axis_limits.yaml-2]: process has finished cleanly [pid 8697] [ros2 launch dobot_motion dobot_PTP.launch.py-7] [PTP_motion_params.yaml-2] Node not found [ros2 launch dobot_motion dobot_PTP.launch.py-7] [ERROR] [PTP_motion_params.yaml-2]: process has died [pid 8715, exit code 1, cmd 'sleep 5;ros2 param load /dobot_PTP_server /home/dear/dev_ws/install/dobot_motion/share/dobot_motion/config/PTP_motion_params.yaml']. [INFO] [ros2 launch dobot_motion dobot_PTP.launch.py-7]: process has finished cleanly [pid 8710] [INFO] [state_publisher-8]: process started with pid [8755] [INFO] [launch.user]: Dobot state updater node started. [INFO] [launch.user]: Dobot Magician control stack has been launched correctly [state_publisher-8] [WARN] Dobot Magician is not connected. [ERROR] [state_publisher-8]: process has died [pid 8755, exit code 1, cmd '/home/dear/dev_ws/install/dobot_state_updater/lib/dobot_state_updater/state_publisher --ros-args'].

jkaniuka commented 11 months ago

Try running just dobot_handle.py and let me know if you get an error

DearMoeurn12 commented 11 months ago

Now, it's working when i am running just dobot_handle.py

but for

ros2 launch dobot_bringup dobot_magician_control_system.launch.py

Error

Dobot Magician is not connected it same error as above

jkaniuka commented 11 months ago

As you can see, the Dobot Magician is not connected warning appears when the serial port cannot be opened.

        try:
            self.serial = serial.Serial(
                port=port,
                baudrate=115200,
                parity=serial.PARITY_NONE,
                stopbits=serial.STOPBITS_ONE,
                bytesize=serial.EIGHTBITS
            )
        except:
            print("[WARN] Dobot Magician is not connected.")
            sys.exit(1)
jkaniuka commented 11 months ago

@DearMoeurn12 are you in dialout group? If not, then add yourself to this group (sudo usermod -a -G dialout <username>) :+1:

DearMoeurn12 commented 11 months ago

i just already config it because i didn't write permissions to all users. now it's working by just run this in terminal. Run sudo chmod a+rw /dev/ttyUSB0

jkaniuka commented 11 months ago

I'm glad it's working, but the command you mentioned is just a temporary solution. After you restart your computer, you will have to execute this command again, that's why I suggested you to add yourself to dialout group because it's a permanent solution :smile:

DearMoeurn12 commented 11 months ago

I appreciate your help, I'll go ahead and add myself to the dialout group for a permanent solution. Thanks for the advice! 😄