Esempio n. 1
0
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    buffer_size = rospy.get_param("/TCP_BUFFER_SIZE", 1024)
    connections = rospy.get_param("/TCP_CONNECTIONS", 10)
    tcp_server = TcpServer(ros_node_name, buffer_size, connections)
    rospy.init_node(ros_node_name, anonymous=True)

    tcp_server.start({
        'rosbridge_msgs_publisher/robot_pos':
        RosSubscriber('rosbridge_msgs_publisher/robot_pos', PosData,
                      tcp_server),
        'rosbridge_msgs_publisher/map':
        RosSubscriber('rosbridge_msgs_publisher/map', MapData, tcp_server),
        'rosbridge_msgs_unity/nav_goals':
        RosPublisher('rosbridge_msgs_unity/nav_goals',
                     Nav2Waypoints,
                     queue_size=10),
        'rosbridge_msgs_unity/interactive_map':
        RosPublisher('rosbridge_msgs_unity/interactive_map',
                     MapData,
                     queue_size=10),
        'rosbridge_msgs_unity/point_groups':
        RosPublisher('rosbridge_msgs_unity/point_groups',
                     PointGroups,
                     queue_size=10),
        'rosbridge_msgs_publisher/point_groups':
        RosSubscriber('rosbridge_msgs_publisher/point_groups', PointGroups,
                      tcp_server),
        'rosbridge_msgs_publisher/current_target':
        RosSubscriber('rosbridge_msgs_publisher/current_target', PosData,
                      tcp_server)
    })

    rospy.spin()
Esempio n. 2
0
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    tcp_server = TcpServer(ros_node_name)
    rospy.init_node(ros_node_name, anonymous=True)

    # Start the Server Endpoint with a ROS communication objects dictionary for routing messages
    tcp_server.start({
        
        #"/unity/ECM/base_frame/": RosPublisher('/dvrk/ECM/set_base_frame/', Pose, queue_size=10),
        #"/unity/PSM1/base_frame/": RosPublisher('/dvrk/PSM1/set_base_frame/', Pose, queue_size=10),
        #"/unity/PSM2/base_frame/": RosPublisher('/dvrk/PSM2/set_base_frame/', Pose, queue_size=10),
        "/unity/ECM/base_frame/": RosPublisher('/unity/ECM/base_frame_output/', Pose, queue_size=10),
        "/unity/PSM1/base_frame/": RosPublisher('/unity/PSM1/base_frame_output/', Pose, queue_size=10),
        "/unity/PSM2/base_frame/": RosPublisher('/unity/PSM2/base_frame_output/', Pose, queue_size=10),
        

        '/unity/Left_Controller/pose/': RosPublisher('/unity/PSM1/set_pose', Pose, queue_size=10),
        '/unity/Right_Controller/pose/': RosPublisher('/unity/PSM2/set_pose', Pose, queue_size=10),

        '/unity/XYZCloud': RosPublisher('/unity/XYZCloud', XYZcloud, queue_size = 10),

        '/dvrk/PSM1/joint_states/': RosSubscriber('/dvrk/PSM1/joint_states/', JointState, tcp_server),
        '/dvrk/PSM2/joint_states/': RosSubscriber('/dvrk/PSM2/joint_states/', JointState, tcp_server),
        '/dvrk/ECM/joint_states/': RosSubscriber('/dvrk/ECM/joint_states/', JointState, tcp_server),

    })
    
    rospy.spin()
Esempio n. 3
0
def main():
    tcp_server = TcpServer("tcp_server", 1024, 10)
    rospy.init_node("tcp_server", anonymous=True)

    tcp_server.start({
        # subscribers
        "base_pose": RosPublisher("base_pose", BasePose, queue_size=1),
        "target_pose": RosPublisher("target_pose", BasePose, queue_size=1),
        "grip_goal_pose": RosPublisher("grip_goal_pose", Pose, queue_size=1),
        "arm_pose": RosPublisher("arm_pose", ArmPose, queue_size=1),
        "dropbox_pose": RosPublisher("dropbox_pose", BasePose, queue_size=1),
        "trajectory_status": RosPublisher("trajectory_status", TrajectoryStatus, queue_size=10),
        "release_pose": RosPublisher("release_pose", Pose, queue_size=1),
        "range_sensor": RosPublisher("range_sensor", Bool, queue_size=1),

        #publishers
        "command": RosSubscriber("command", Command, tcp_server),
        "arm_trajectories": RosSubscriber("arm_trajectories", Trajectories, tcp_server),

        #services
        "trajectory_planner": RosService("trajectory_planner", TrajectoryPlanner),
        "forward_kinematics": RosService("forward_kinematics", ForwardKinematics),
        "inverse_kinematics": RosService("inverse_kinematics", InverseKinematics),
        "start_system": RosService("start_system", StartSystem)
    })

    rospy.spin()
Esempio n. 4
0
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    tcp_server = TcpServer(ros_node_name)

    # Start the Server Endpoint
    rospy.init_node(ros_node_name, anonymous=True)
    tcp_server.start()
    rospy.spin()
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    buffer_size = rospy.get_param("/TCP_BUFFER_SIZE", 1024)
    connections = rospy.get_param("/TCP_CONNECTIONS", 10)
    tcp_server = TcpServer(ros_node_name, buffer_size, connections)
    rospy.init_node(ros_node_name, anonymous=True)

    tcp_server.start({
        'joint_states': RosPublisher('joint_states', JointState, queue_size=10),
        'joint_command': RosSubscriber('joint_command', JointState, tcp_server)
    })
    rospy.spin()
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    tcp_server = TcpServer(ros_node_name)
    rospy.init_node(ros_node_name, anonymous=True)

    # Start the Server Endpoint with a ROS communication objects dictionary for routing messages
    tcp_server.start({
        'SourceDestination_input': RosPublisher('SourceDestination', NiryoMoveitJoints, queue_size=10),
        'NiryoTrajectory': RosSubscriber('NiryoTrajectory', NiryoTrajectory, tcp_server),
        'niryo_moveit': RosService('niryo_moveit', MoverService)
    })
    
    rospy.spin()
Esempio n. 7
0
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    buffer_size = rospy.get_param("/TCP_BUFFER_SIZE", 1024)
    connections = rospy.get_param("/TCP_CONNECTIONS", 10)
    tcp_server = TcpServer(ros_node_name, buffer_size, connections)
    rospy.init_node(ros_node_name, anonymous=True)
    
    tcp_server.start({
        'pos_srv': RosService('position_service', PositionService),
        'pos_rot': RosPublisher('pos_rot', PosRot, queue_size=10),
        'color': RosSubscriber('color', UnityColor, tcp_server)
    })
    
    rospy.spin()
Esempio n. 8
0
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    tcp_server = TcpServer(ros_node_name)
    rospy.init_node(ros_node_name, anonymous=True)

    # Start the Server Endpoint with a ROS communication objects dictionary for routing messages
    tcp_server.start({
        'UR3Trajectory':
        RosSubscriber('UR3Trajectory', UR3Trajectory, tcp_server),
        'ur3_moveit':
        RosService('ur3_moveit', MoverService),
        'pose_estimation_srv':
        RosService('pose_estimation_service', PoseEstimationService)
    })

    rospy.spin()
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    buffer_size = rospy.get_param("/TCP_BUFFER_SIZE", 1024)
    connections = rospy.get_param("/TCP_CONNECTIONS", 10)
    tcp_server = TcpServer(ros_node_name, buffer_size, connections)
    rospy.init_node(ros_node_name, anonymous=True)

    tcp_server.start({
        'index_1Pose':
        RosSubscriber('index_1Pose', geometry_msgs.msg.PoseStamped,
                      tcp_server),
        'index_2Pose':
        RosSubscriber('index_2Pose', geometry_msgs.msg.PoseStamped,
                      tcp_server),
    })

    rospy.spin()
def main():
    ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
    buffer_size = rospy.get_param("/TCP_BUFFER_SIZE", 1024)
    connections = rospy.get_param("/TCP_CONNECTIONS", 10)
    tcp_server = TcpServer(ros_node_name, buffer_size, connections)
    # tcp_server = TcpServer(ros_node_name)
    rospy.init_node(ros_node_name, anonymous=True)

    tcp_server.start({
        'String':
        RosSubscriber('HelloWorld', Text, tcp_server),
        'SubJoints':
        RosPublisher('JointsSub', UR10eJoints, queue_size=10),
        'MoveJoints':
        RosSubscriber('JointsMover', UR10eJoints, tcp_server)
    })

    rospy.spin()
def setup_kinematic_server():
    """
    Setup a unity TCP server which proxy the messages from and to Unity.
    It automatically setup a list of proxies for kinematic relevant ROS topics.

    /joint_states is used as the default joint configuration publisher for all controllers

    For each controller which is configured in the unity_moveit_controller_manager
    it sets up a controller topic with the following path

    /move_group/unity_trajectory/<CONTROLLER_NAME>

    This script is intended to work with unity_moveit_manager.cpp
    """
    ros_node_name = rospy.get_param(TCP_NODE_NAME_PARAM, 'TCPServer')
    buffer_size = rospy.get_param(TCP_BUFFER_SIZE_PARAM, 1024)
    connections = rospy.get_param(TCP_CONNECTIONS_PARAM, 10)

    tcp_server = TcpServer(ros_node_name, buffer_size, connections)
    rospy.init_node(ros_node_name, anonymous=True, log_level=rospy.INFO)

    rospy.loginfo('Advertising /joint_states for the joint configuration')
    topics = {
        'joint_states': RosPublisher(ROS_JOINT_STATES_TOPIC, JointState),
    }

    for controller in rosparam.get_param(UNITY_CONTROLLER_LIST_PARAM):
        controller_name = controller['name']
        topics[controller_name] = RosSubscriber(UNITY_CONTROLLER_BASE + controller_name,
                                                JointTrajectory,
                                                tcp_server)
        rospy.loginfo(f'Listening to {UNITY_CONTROLLER_BASE + controller_name} '
                      f'for the trajectory execution')

    tcp_server.start(topics)

    rospy.spin()