ruby-player 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.travis.yml +5 -0
- data/Guardfile +5 -0
- data/README.md +10 -17
- data/TODO.md +1 -12
- data/examples/simple_example.rb +27 -0
- data/{spec → examples}/world/test.cfg +0 -0
- data/{spec → examples}/world/test.world +5 -5
- data/lib/ruby-player.rb +12 -5
- data/lib/ruby-player/client.rb +136 -42
- data/lib/ruby-player/common.rb +44 -7
- data/lib/ruby-player/constants.rb +584 -0
- data/lib/ruby-player/dev_addr.rb +59 -0
- data/lib/ruby-player/device.rb +60 -0
- data/lib/ruby-player/header.rb +81 -0
- data/lib/ruby-player/position2d.rb +161 -91
- data/lib/ruby-player/ranger.rb +118 -88
- data/lib/ruby-player/version.rb +1 -1
- data/ruby-player.gemspec +3 -1
- data/spec/client_spec.rb +145 -11
- data/spec/position2d_spec.rb +115 -46
- data/spec/ranger_spec.rb +132 -41
- metadata +36 -28
- data/lib/ruby-player/c_type.rb +0 -36
- data/lib/ruby-player/c_type/bbox3d_t.rb +0 -24
- data/lib/ruby-player/c_type/client_t.rb +0 -36
- data/lib/ruby-player/c_type/devaddr.rb +0 -24
- data/lib/ruby-player/c_type/device_t.rb +0 -35
- data/lib/ruby-player/c_type/diagnostic.rb +0 -22
- data/lib/ruby-player/c_type/pose3d_t.rb +0 -27
- data/lib/ruby-player/c_type/position2d_t.rb +0 -32
- data/lib/ruby-player/c_type/ranger_t.rb +0 -42
- data/lib/ruby-player/c_type/sockaddr_in_t.rb +0 -24
@@ -1,24 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
module Player
|
16
|
-
module CType
|
17
|
-
class DevAddrStruct < FFI::Struct
|
18
|
-
layout :host, :uint32,
|
19
|
-
:robot, :uint32,
|
20
|
-
:interf, :uint16,
|
21
|
-
:index, :uint16
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
module Player
|
16
|
-
module CType
|
17
|
-
class DeviceStruct < FFI::Struct
|
18
|
-
layout :id, :pointer,
|
19
|
-
:client, :pointer,
|
20
|
-
:addr, DevAddrStruct,
|
21
|
-
:drivername, [:char, PLAYER_MAX_DRIVER_STRING_LEN],
|
22
|
-
:subcribed, :int,
|
23
|
-
:datatime, :double,
|
24
|
-
:lasttime, :double,
|
25
|
-
:fresh, :int,
|
26
|
-
:freshdgeom, :int,
|
27
|
-
:freshconfig, :int,
|
28
|
-
:putmsg, :pointer,
|
29
|
-
:user_data, :pointer,
|
30
|
-
:callback_count, :int,
|
31
|
-
:calback, [:pointer, 4],
|
32
|
-
:calback_data, [:pointer, 4]
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
require "ffi"
|
16
|
-
|
17
|
-
module Player
|
18
|
-
module Binding
|
19
|
-
module Diagnostic
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
module Player
|
16
|
-
module CType
|
17
|
-
class Pose3dStruct < FFI::Struct
|
18
|
-
layout :px, :double,
|
19
|
-
:py, :double,
|
20
|
-
:pz, :double,
|
21
|
-
:proll, :double,
|
22
|
-
:ppitch, :double,
|
23
|
-
:pyaw, :double
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
module Player
|
16
|
-
module CType
|
17
|
-
class Position2dStruct < FFI::Struct
|
18
|
-
layout :info, DeviceStruct,
|
19
|
-
:pose, [:double, 3],
|
20
|
-
:size, [:double, 2],
|
21
|
-
|
22
|
-
:px, :double,
|
23
|
-
:py, :double,
|
24
|
-
:pa, :double,
|
25
|
-
|
26
|
-
:vx, :double,
|
27
|
-
:vy, :double,
|
28
|
-
:va, :double,
|
29
|
-
:stall, :int
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
module Player
|
16
|
-
module CType
|
17
|
-
class RangerStruct < FFI::Struct
|
18
|
-
layout :info, DeviceStruct,
|
19
|
-
:element_count, :uint32,
|
20
|
-
:min_angle, :double,
|
21
|
-
:max_angle, :double,
|
22
|
-
:angular_res, :double,
|
23
|
-
:min_range, :double,
|
24
|
-
:max_range, :double,
|
25
|
-
:range_res, :double,
|
26
|
-
:frequecy, :double,
|
27
|
-
:device_pose, Pose3dStruct,
|
28
|
-
:device_size, BBox3dStruct,
|
29
|
-
:element_poses, :pointer,
|
30
|
-
:element_sizes, :pointer,
|
31
|
-
:ranges_count, :uint32,
|
32
|
-
:ranges, :pointer,
|
33
|
-
:intensities_count, :uint32,
|
34
|
-
:intensities, :pointer,
|
35
|
-
:bearings_count, :uint32,
|
36
|
-
:bearings, :pointer,
|
37
|
-
:points_count, :uint32,
|
38
|
-
:points, :pointer
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Ruby Player - Ruby client library for Player (tools for robots)
|
2
|
-
#
|
3
|
-
# Copyright (C) 2012 Timin Aleksey
|
4
|
-
#
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
8
|
-
# (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
14
|
-
|
15
|
-
module Player
|
16
|
-
module CType
|
17
|
-
class SockaddrInStruct < FFI::Struct
|
18
|
-
layout :sin_family, :short,
|
19
|
-
:sin_port, :short,
|
20
|
-
:sin_addr, :int32,
|
21
|
-
:sin_zero, [:char, 8]
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|