コード例 #1
0
ファイル: recorder.py プロジェクト: jmfajardod/robotino-imu
def data_collector(hertz=50, samples=20, mv_type='curve_m', left=False, degree=None):
    token = connect()

    #init publisher
    pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
    rospy.init_node('collector', anonymous=True)
    mvs = mv.MovementSet(pub, hertz)

    print('%s - %s' % (mv_type, 'left' if left else 'right'))

    #repeat movement for each sample
    for k in range(samples):
        if rospy.is_shutdown():
                return
                
        #type of movement
        #labels = ["curve_m"]
        #samples,vel,ang = mvs.mv_curve_middle()
        labels,fn = mt.get_mv(mvs, mv_type, left=left, degree=degree)
        samples,vel,ang,rad = fn()
                
        #stop robotino
        pub.publish(Twist())
        print("sample no. %s done" % k)
        save_sample(token, sample_run+k, samples, labels, hertz, vel, ang, rad)
コード例 #2
0
class GiantBombardierBeetle(Insect):
    name = "Giant Bombardier Beetle"
    hit_dice = dice.D8(2)

    attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount)
    attack_sets = [AttackSet(Bite(dice.D4(1)))]
    base_armor_class = 16
    morale = 9
    movement = movement.MovementSet(walk=units.FeetPerGameTurn(10), fly=units.Feet(50))
    no_appearing = AppearingSet(dice_dungeon=dice.D6(1), dice_wild=dice.D6(1), dice_lair=dice.D6(5))
    save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set
    special_abilities = specialabilities.CombatFrenzy,
    treasure_type = TreasureType.Special
    xp = 13
コード例 #3
0
class AssassinVine(Plant):
    name = "Assassin Vine"
    hit_dice = dice.D8(6)

    attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount)
    attack_sets = [
        AttackSet(Crush(dice.D8(1)),
                  special_properties=(CrushingEntanglement, ))
    ]
    base_armor_class = 15
    morale = 12
    movement = movement.MovementSet(walk=units.FeetPerGameTurn(5))
    no_appearing = AppearingSet(dice_dungeon=dice.D4(1, 1))
    save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set
    treasure_type = TreasureType.U
    xp = 500
コード例 #4
0
def data_collector(hertz=10, samples=10):
    token = 0

    #init publisher
    pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
    rospy.init_node('collector', anonymous=True)
    mvs = mv.MovementSet(pub, hertz)

    #repeat movement for each sample
    for k in range(samples):
        if rospy.is_shutdown():
            return

        labels, fn = mt.get_mv(mvs, 'curve_s')
        samples, vel, ang = fn()

        #stop robotino
        pub.publish(Twist())
        print("sample no. %s done" % k)
        save_sample(token, sample_run + k, samples, labels, hertz, vel, ang)
コード例 #5
0
class Basilisk(Insect):
    name = "Basilisk"
    hit_dice = dice.D8(6)

    attack_bonus = AttackBonusTable.get_by_hit_dice(hit_dice.amount)
    attack_sets = [
        AttackSet(Bite(dice.D10(1))),
        AttackSet(Gaze(None), special_properties=specialproperties.Petrify)
    ]
    base_armor_class = 16
    morale = 9
    movement = movement.MovementSet(walk=units.FeetPerGameTurn(20),
                                    turning_distance=units.Feet(10))
    no_appearing = AppearingSet(dice_dungeon=dice.D6(1),
                                dice_wild=dice.D6(1),
                                dice_lair=dice.D6(1))
    save_as = Fighter.level_table.levels[hit_dice.amount].saving_throws_set
    special_abilities = specialabilities.CombatFrenzy,
    treasure_type = TreasureType.F
    xp = 610