首页 > 其他分享 >C——error: expected ‘:‘, ‘,‘, ‘;‘, ‘}‘ or ‘__attribute__‘ before ‘=‘ token的解决办法

C——error: expected ‘:‘, ‘,‘, ‘;‘, ‘}‘ or ‘__attribute__‘ before ‘=‘ token的解决办法

时间:2022-12-07 12:00:11浏览次数:35  
标签:__ attribute float step height down token trajectory amp


一、原因

结构体中包含变量的初始化。

二、报错代码

struct GaitParams {
float stance_height = 0.18; // Desired height of body from ground during walking (m)
float down_amp = 0.00; // Peak amplitude below stanceHeight in sinusoidal trajectory (m)
float up_amp = 0.06; // Height the foot peaks at above the stanceHeight in sinusoidal trajectory (m)
float flight_percent = 0.6; // Portion of the gait time should be doing the down portion of trajectory
float step_length = 0.0; // Length of entire step (m)
float freq = 1.0; // Frequency of one gait cycle (Hz)
float step_diff = 0.0; //difference between left and right leg step length
};

三、正确代码

struct GaitParams {
float stance_height; // Desired height of body from ground during walking (m)
float down_amp; // Peak amplitude below stanceHeight in sinusoidal trajectory (m)
float up_amp; // Height the foot peaks at above the stanceHeight in sinusoidal trajectory (m)
float flight_percent; // Portion of the gait time should be doing the down portion of trajectory
float step_length; // Length of entire step (m)
float freq; // Frequency of one gait cycle (Hz)
float step_diff; //difference between left and right leg step length
};


标签:__,attribute,float,step,height,down,token,trajectory,amp
From: https://blog.51cto.com/u_15905131/5918543

相关文章

  • 过渡和动画
    动画效果<scriptsetup>import{ref}from'vue'letname=ref('test')letisShow=ref(true)</script><template><button@click="isShow=!isShow">显......
  • m基于PSO粒子群优化的Hammerstein模型参数辨识算法matlab仿真,对比LS最小二乘法
    1.算法概述        粒子群优化算法(PSO)是一种进化计算技术(evolutionarycomputation),1995年由Eberhart博士和kennedy博士提出,源于对鸟群捕食的行为研究。该......
  • PS---套索工具del键删除不了【解决方案】
    最近在用PS进行一些抠图操作,遇到一个奇怪的问题,就是使用套索工具来选择后,按删除键,删除不了点,或者是在删除点后,就无法再次选中的问题。万万没想到这个是微软输入法的问题:wi......
  • docker 1.13版本修改默认存储路径及添加私有registry
    1、服务器安装dockeryuminstalldocker-y12、修改配置文件方法1:编辑`/etc/sysconfig/docker`文件修改`OPTION`选项添加--insecure-registry=10.0.17.205:4000方法2......
  • USB总线-RK3399 USB3.0控制器特性介绍(二)
    1.RK3399USB下图是RK3399SOC的框图。RK3399包含了2个USB2.0Host控制器;两个USB3.0OTG控制器,同时兼容USB2.0。USB3.0使用的是Synopsys公司的IP,驱动也使用Synopsys的dwc3......
  • Linux中查看各文件夹大小命令:du -h --max-depth=1
    du[-abcDhHklmsSx][-L<符号连接>][-X<文件>][--block-size][--exclude=<目录或文件>][--max-depth=<目录层数>][--help][--version][目录或文件]常用参数:-a或-all......
  • React组件通信
    react因为组件化,使得组件间通信十分的重要。本文就来简单介绍一些常见的react组件间传递的内容。我将归纳为以下几种关系来详述:父组件与子组件之间,子组件与父组件之间,发......
  • props配置
    实例App.vue文件<scriptsetup>importStudentfrom'./components/Student.vue'import{ref}from'vue'letaddress=ref('上海')</script><template><div>......
  • React组件设计模式-纯组件,函数组件,高阶组件
    一、组件(1)函数组件如果你想写的组件只包含一个render方法,并且不包含state,那么使用函数组件就会更简单。我们不需要定义一个继承于React.Component的类,我们可以定......
  • windows下MySQL5和Mysql8共存
    下载MYSQL压缩包mysql8下载地址:https://dev.mysql.com/downloads/mysql/mysql5下载地址:https://downloads.mysql.com/archives/community/建议选择下载压缩版本的,......