Skip to content

Commit 1eb8cb1

Browse files
committed
change default gravity in PlanarMechanics to be consistent with 3D
1 parent 506a4c4 commit 1eb8cb1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/PlanarMechanics/components.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Frame fixed in the planar world frame at a given position and orientation
2929
end
3030

3131
"""
32-
Body(; name, m=1, I=0.1, r=0, gy=-9.807, radius=0.1, render=true, color=Multibody.purple)
32+
Body(; name, m=1, I=0.1, r=0, gy=-9.80665, radius=0.1, render=true, color=Multibody.purple)
3333
3434
Body component with mass and inertia
3535
3636
# Parameters:
3737
- `m`: [kg] mass of the body
3838
- `I`: [kg.m²] inertia of the body with respect to the origin of `frame` along the z-axis of `frame`
3939
- `r`: [m, m] Translational position x,y-position
40-
- `gy`: [m/s²] gravity field acting on the mass in the y-direction, positive value acts in the positive direction defaults to -9.807
40+
- `gy`: [m/s²] gravity field acting on the mass in the y-direction, positive value acts in the positive direction defaults to -9.80665
4141
- `radius`: [m] Radius of the body in animations
4242
- `render`: [Bool] Render the body in animations
4343
- `color`: [Array{Float64,1}] Color of the body in animations
@@ -53,7 +53,7 @@ Body component with mass and inertia
5353
# Connectors:
5454
- `frame`: 2-dim. Coordinate system
5555
"""
56-
@component function Body(; name, m, I, r = zeros(2), v=nothing, phi = nothing, w=nothing, gy = -9.807, radius=0.1, render=true, color=Multibody.purple, state_priority=2)
56+
@component function Body(; name, m, I, r = zeros(2), v=nothing, phi = nothing, w=nothing, gy = -9.80665, radius=0.1, render=true, color=Multibody.purple, state_priority=2)
5757
@named frame_a = Frame()
5858
pars = @parameters begin
5959
m = m, [description = "Mass of the body"]

test/test_PlanarMechanics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Multibody.PlanarMechanics as Pl
77
using JuliaSimCompiler
88

99
tspan = (0.0, 3.0)
10-
g = -9.807
10+
g = -9.80665
1111

1212
@testset "Free body" begin
1313
m = 2

0 commit comments

Comments
 (0)