4 from nav_msgs.msg
import OccupancyGrid, MapMetaData
10 data = -np.ones((30, 30), np.int8)
11 data[10:20, 10:20] = 100
13 msg = ros_numpy.msgify(OccupancyGrid, data)
15 data_out = ros_numpy.numpify(msg)
17 self.assertIs(data_out[5, 5], np.ma.masked)
18 np.testing.assert_equal(data_out[10:20, 10:20], 100)
26 data = [0, 0, 0, 0, -1, 0, 0, 0, 0]
29 data = ros_numpy.numpify(msg)
30 self.assertIs(data[1,1], np.ma.masked)
31 msg2 = ros_numpy.msgify(OccupancyGrid, data)
33 self.assertEqual(msg.info, msg2.info)
40 self.assertEqual(io1.getvalue(), io2.getvalue(),
"Message serialization survives round-trip")
42 if __name__ ==
'__main__':
def test_serialization(self)