浏览代码

Merge branch 'main' into origin/dev

/devin-main-fix
LaurieCheers 4 年前
当前提交
8f3d4be6
共有 3 个文件被更改,包括 53 次插入1 次删除
  1. 26
      tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/server_endpoint.py
  2. 2
      tutorials/pick_and_place/docker/Dockerfile
  3. 26
      tutorials/ros_packages/robotics_demo/scripts/server_endpoint.py

26
tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/server_endpoint.py


#!/usr/bin/env python
import rospy
from ros_tcp_endpoint import TcpServer, RosPublisher, RosSubscriber, RosService
from niryo_moveit.msg import NiryoMoveitJoints, NiryoTrajectory
from niryo_moveit.srv import MoverService
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()
if __name__ == "__main__":
main()

2
tutorials/pick_and_place/docker/Dockerfile


RUN /bin/bash -c "find $ROS_WORKSPACE -type f -print0 | xargs -0 dos2unix"
RUN dos2unix /tutorial /setup.sh && chmod +x /setup.sh && /setup.sh && rm /setup.sh
RUN dos2unix /tutorial && dos2unix /setup.sh && chmod +x /setup.sh && /setup.sh && rm /setup.sh
WORKDIR $ROS_WORKSPACE

26
tutorials/ros_packages/robotics_demo/scripts/server_endpoint.py


#!/usr/bin/env python
import rospy
from ros_tcp_endpoint import TcpServer, RosPublisher, RosSubscriber, RosService
from robotics_demo.msg import PosRot, UnityColor
from robotics_demo.srv import PositionService
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()
if __name__ == "__main__":
main()
正在加载...
取消
保存