Skip to content

@mtkmodel: more than one statement in if branch #2967

Open
@baggepinnen

Description

@baggepinnen

Component definitions like this are okay inside the @mtkmodel macro

if inertial_wheels
    front_wheels = RollingWheelSet(radius=wheel_radius, m_wheel=wheel_mass, I_axis, I_long, track=wheel_d, state_priority=100)
else
    front_wheels = RollingWheelSetJoint(radius=wheel_radius, track=wheel_d, state_priority=100)
end

if inertial_wheels
    rear_wheels = RollingWheelSet(radius=wheel_radius, m_wheel=wheel_mass, I_axis, I_long, track=wheel_d, state_priority=100, iscut=true)
else
    rear_wheels = RollingWheelSetJoint(radius=wheel_radius, track=wheel_d, state_priority=100, iscut=true)
end

but putting both components in the same if statement

if inertial_wheels
    front_wheels = RollingWheelSet(radius=wheel_radius, m_wheel=wheel_mass, I_axis, I_long, track=wheel_d, state_priority=100)
    rear_wheels = RollingWheelSet(radius=wheel_radius, m_wheel=wheel_mass, I_axis, I_long, track=wheel_d, state_priority=100, iscut=true)
else
    front_wheels = RollingWheelSetJoint(radius=wheel_radius, track=wheel_d, state_priority=100)
    rear_wheels = RollingWheelSetJoint(radius=wheel_radius, track=wheel_d, state_priority=100, iscut=true)
end

errors with front_wheels not defiend.

This problem appears in @equations as well, one can only have one equation per branch at the moment.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions