Skip to content

Can't acces doosan controller IO ports #357

@Fendernt

Description

@Fendernt

Best,

We are trying to control a doosan M1013 using ROS2 humble.
We already used this doosan ros build to move the robot and tested it with a simple opencv project that sends data to the robot to move. everything works fine.

Now we are trying to link more advanced sensors onto the doosan controller, but we can't get a readout on IO ports from the ros2 humble environment.

There does not seem to be any IO topics or nodes running?

ros2 topic list | grep io
/dsr01/alter_motion_stream
/dsr01/dsr_controller2/transition_event
/dsr01/joint_state_broadcaster/transition_event
/dsr01/robot_description
/dsr01/robot_disconnection
/rt_topic/actual_joint_position
ros2 node list
/dsr01/controller_manager
/dsr01/dsr_controller2
/dsr01/joint_state_broadcaster
/dsr01/robot_state_publisher
/dsr01/rviz2
/dsr01/transform_listener_impl_566a923f3730

My assumption is because we are launching using gazebo, rviz and/or moveit and this does not initialise thie IO connection, but i can't find any other way of launching it. My only options are:

dsr_bringup2_gazebo.launch.py
dsr_bringup2_moveit.launch.py
dsr_bringup2_mujoco.launch.py
dsr_bringup2_rviz.launch.py
dsr_bringup2_spawn_on_gazebo.launch.py

Are we doing something wrong? I'd love to hear more on this, thank you in advance.

edit:

To clarify, the function get_digital_input(pin) always returns 0.
There does seem to be a service running

ros2 service list | grep digital
/dsr01/io/get_ctrl_box_digital_input
/dsr01/io/get_ctrl_box_digital_output
/dsr01/io/get_tool_digital_input
/dsr01/io/get_tool_digital_output
/dsr01/io/set_ctrl_box_digital_output
/dsr01/io/set_tool_digital_output

Tested code:

import rclpy
import DR_init
import sys
import random
import time

def main(args=None):
    rclpy.init(args=args)

    ROBOT_ID = "dsr01"
    ROBOT_MODEL = "m1013"
    DR_init.__dsr__id = ROBOT_ID
    DR_init.__dsr__model = ROBOT_MODEL

    node = rclpy.create_node('example_py', namespace=ROBOT_ID)

    DR_init.__dsr__node = node

    from DSR_ROBOT2 import movej, posj, set_robot_mode, ROBOT_MODE_AUTONOMOUS, get_robot_mode, get_current_pose, get_digital_input, get_modbus_input

    if get_robot_mode() != ROBOT_MODE_AUTONOMOUS:
        set_robot_mode(ROBOT_MODE_AUTONOMOUS)

    while(1):
        rclpy.spin_once(node, timeout_sec=0.01)

    #     pos_j = get_current_pose(0)
    #     pos_x = get_current_pose(1)
    #     print(str(pos_j) +" | " +str(pos_x))
        ii = 1
        while ii <= 16:
            print(str(ii) +": "+str(get_digital_input(ii)))
            ii+=1
        print()
        
        time.sleep(0.1)
    

    print("Example complete")
    rclpy.shutdown()

if __name__ == '__main__':
    main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingCurrently analyzing the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions