Merging two sick scangrid2 readed from PLC DELTA

asked 2023-01-24 09:36:41 -0500

Blachowskyy gravatar image

Hi! :) I have two Sick ScanGrid2 ( CAN version ) and I'm reading the data trough PLC Delta. I've published two topics /scangrid_1 and /scangrid_2 witch data (Int64MultiArray) but the ira_laser_tools don't recognise this as laserscan topic. How to make it work?

scangrid2.py

scangrid2_pub1 = rospy.Publisher('scangrid_1', Int64MultiArray, queue_size=10)
scangrid2_pub2 = rospy.Publisher('scangrid_2', Int64MultiArray, queue_size=10)
rospy.init_node('publisher', anonymous=True)


delta = ModbusClient(host='192.168.1.5',port=502,auto_open=True, auto_close=True)
rate = rospy.Rate(30) # 1hz
rospy.loginfo("Publisher high started")
scangrid1 = Int64MultiArray()
scangrid2 = Int64MultiArray()
while not rospy.is_shutdown():

    scangrid1.data = delta.read_holding_registers(24032, 32)
    scangrid2.data = delta.read_holding_registers(24064, 32)


    rospy.loginfo("Scangrid data active")



    scangrid2_pub1.publish(scangrid1)
    scangrid2_pub2.publish(scangrid2)
    rate.sleep()
    clear = lambda: os.system('clear')
    clear()

laserscan_multi_merger

<launch>
<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
<param name="destination_frame" value="/base_link"/>
<param name="cloud_destination_topic" value="/cloud_merged_scangrid"/>
<param name="scan_destination_topic" value="/scan_merged_scangrid"/>
<param name="laserscan_topics" value ="/scangrid_1 /scangrid_2" /> <!-- LIST OF THE LASER SCAN TOPICS TO SUBSCRIBE -->
<param name="angle_min" value="0"/>
<param name="angle_max" value="270"/>
<param name="angle_increment" value="0.0058"/>
<param name="scan_time" value="0.0333333"/>
<param name="range_min" value="0"/>
<param name="range_max" value="10"/>
<param name="intensities" value="0"/>
</node>

</launch>

I'm using standard ira launcher with Sick microscan3 and it's work fine but theres a special library from sick company... It wont work for reading scanners from PLC.

edit retag flag offensive close merge delete