robocup3d周报

周报–Franpin

  • 测比赛

    1. 发现鲁东的带球特别的好,带球很快很灵活
    2. 我们的守门员不太行(扑球不准)
    3. 发现了一个bug就是球离我方球员很近的时候,我方球员会把球踢到自己球门

在这里插入图片描述

  • 写了一个步态优化任务,主要是想让他kickball()的时候步态参数由sprint切换为approach。
SkillType OptimizationBehaviorWalkOmi::task_Sprint_turn_Approach(){

        static int x = 1;
        VecPosition target;

        VecPosition myPosition = worldModel->getMyPositionGroundTruth();
        VecPosition ballPosition = worldModel->getBallGroundTruth();
        if(myPosition.getDistanceTo(ballPosition)<1){
            x++;
        }
        switch (x%4)
        {
        case 1:
            target=VecPosition(15,-10,0);
            break;
        case 2:
            target=VecPosition(15,10,0);
            break;
        case 3:
            target=VecPosition(-15,10,0);
            break;
        case 4:
            target=VecPosition(-15,-10,0);
            break;
        default:
            break;
        }
        SkillType ret=kickBall(KICK_FORWARD,target);
        return ret;
    }

优化图片

  • 看了看ut原始的优化底层,用ut原始的sample_start-optimization.sh写了一个优化的python脚本,虽然没有咱们实验室那样高级,但是能跑起来(亲测,培训的时候给他们讲讲)。
 	import cma
    import os

    std_list =[21.878452192908963,
    -107.2655684773586,
    -46.03084224893723,
    122.50096005151583,
    36.70802042526406,
    74.34964372370875,
    -23.35326324263892,
    -1.411851711850464,
    4.8436144712052585,
    -12.878536016473056,
    8.73474032972045,
    -2.0087222938685585,
    2.4649510821897755,
    -0.19721363030046984,
    -0.07855676227334851,
    7.790202814460635,
    5.980745105156915,
    0.60539945683587]
    #[11.6140517708,-4.9171027329,0.3251961719,-2.496460126,4.1228343724,4.8159507012,27.8958518161,34.1181422294,2.547294129,-3.247463629,-9.7463724405,-18.8513479245,0.2107818939,-2.8414504055,-0.6188735371,-8.6481949996,58.3129345744,58.8881654843,6.4995162332,14.6678754125,-0.2613845865,-0.0358574055]
    #[-2.0087222938685585,2.4649510821897755,-10,-10,5,5,10,5,5,-10,-10,5,5,10,-10,5,-5,5,-0.223707187448,-0.0722786582128]
    #[11.6140517708,-4.9171027329,0.3251961719,-2.496460126,4.1228343724,4.8159507012,27.8958518161,34.1181422294,2.547294129,-3.247463629,-9.7463724405,-18.8513479245,0.2107818939,-2.8414504055,-0.6188735371,-8.6481949996,58.3129345744,58.8881654843,6.4995162332,14.6678754125,-0.2613845865,-0.0358574055]

    def writeToFile(paramList, filePath):
        file = open(filePath, 'r+')
        paramLines = file.readlines()
        file.close()
        paramNames = [i.split()[0] for i in paramLines]

        newLines = []
        for i in range(len(paramNames)):
            newLines.append(paramNames[i] + '\t' + str(paramList[i]) + '\n')

        file = open(filePath, 'w+')
        file.writelines(newLines)
        file.close()


    def run(paramList, roboType, absPath):
        writeToFile(paramList, '../paramfiles/optimizing.txt')
        command1 = './sample_start-optimization.sh {0} {1} ./out'.format(roboType, absPath)
        os.system(command1)
        command2 = 'pkill -9 rcss'
        os.system(command2)
        file = open('./out')
        lines = file.readlines()
        file.close()
        rst = lines[0]
        print("rst: ",rst)
        return float(rst)
    def eva(ind):
        paramList = []
            
        for x in range(0, len(ind)):
            paramList.append(ind[x] * std_list[x])

        score = run(paramList, 1, '../paramfiles/optimizing.txt')
        file = open('./out2', 'a')
        newLines = []
        for i in range(len(paramList)):
            newLines.append(str(paramList[i]) + ',')
        newLines.append(str(score) + '\n')
        file.writelines(newLines)
        file.close()
        return 30-score

    cma.fmin(eva, len(std_list)*[1.1], 0.3)
	setMonMessage( (ball (pos <x> <y> <z>)  (vel <x> <y> <z>)))
  • 在优化步态的时候发现有些步态优化任务里gototarget()函数里的内部被修改了,所以在kickball()过程中离球很近时步态参数没有转变为approach。
  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值