JuliaRobotics / RigidBodyDynamics.jl

Julia implementation of various rigid body dynamics and kinematics algorithms
Other
287 stars 48 forks source link

Fix deprecation warnings on 0.7 #445

Closed tkoolen closed 6 years ago

tkoolen commented 6 years ago

Master is in pretty good shape for 0.7 now, but still a bunch of deprecation warnings to fix.

Results of running tests (up until IntervalArithmetic notebook; IntervalArithmetic is still broken) for future reference:

Test Summary: | Pass  Total
exports       |  157    157
┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of
│ type `x::DirectedGraph{Vertex{Int64},Edge{Float64}}` with `Ref(x)` to ensure they broadcast as "scalar" elements.
│   caller = ip:0x0
└ @ Core :-1
Test Summary: | Pass  Total
graphs        | 5335   5335
Test Summary:      | Pass  Total
custom collections |   29     29
┌ Warning: `At_mul_B(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T, S}` is deprecated, use `transpose(A) * x` instead.
│   caller = macro expansion at frame.jl:66 [inlined]
└ @ Core frame.jl:66
┌ Warning: `At_mul_B(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T, S}` is deprecated, use `transpose(A) * x` instead.
│   caller = macro expansion at frame.jl:66 [inlined]
└ @ Core frame.jl:66
Test Summary: | Pass  Total
frames        |   20     20
┌ Warning: `mapslices(op, A::AbstractArray, dims)` is deprecated, use `mapslices(op, A, dims=dims)` instead.
│   caller = colwise at util.jl:29 [inlined]
└ @ Core util.jl:29
Test Summary: | Pass  Total
spatial       |  951    951
Test Summary: | Pass  Total
contact       |  300    300
Test Summary: | Pass  Total
URDF parser   |   36     36
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_positions(::Mechanism{Float64}) at mechanism.jl:117
└ @ RigidBodyDynamics mechanism.jl:117
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_velocities(::Mechanism{Float64}) at mechanism.jl:124
└ @ RigidBodyDynamics mechanism.jl:124
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_constraints(::Mechanism{Float64}) at mechanism.jl:131
└ @ RigidBodyDynamics mechanism.jl:131
Test Summary:   | Pass  Total
double pendulum |   12     12
Test Summary: | Pass  Total
StateCache    |    8      8
Test Summary:       | Pass  Total
DynamicsResultCache |    8      8
Test Summary:        | Pass  Total
SegmentedVectorCache |    8      8
┌ Warning: `showcompact(io, x)` is deprecated, use `show(IOContext(io, :compact => true), x)` instead.
│   caller = macro expansion at test_mechanism_algorithms.jl:31 [inlined]
└ @ Core test_mechanism_algorithms.jl:31
┌ Warning: `showcompact(io, x)` is deprecated, use `show(IOContext(io, :compact => true), x)` instead.
│   caller = macro expansion at test_mechanism_algorithms.jl:31 [inlined]
└ @ Core test_mechanism_algorithms.jl:31
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_velocities(::TreePath{RigidBody{Float64},Joint{Float64,JT} where JT<:JointType{Float64}}) at mechanism_state.jl:374
└ @ RigidBodyDynamics mechanism_state.jl:374
┌ Warning: Constructors no longer fall back to `convert`. A constructor `ForwardDiff.Dual{Nothing,Float64,1}(::Float64)` should be defined instead.
│   caller = rotation_vector_rate(::SArray{Tuple{3},ForwardDiff.Dual{Nothing,Float64,1},1,3}, ::Array{ForwardDiff.Dual{Nothing,Float64,1},1}) at util.jl:94
└ @ RigidBodyDynamics.Spatial util.jl:94
Test Summary:        | Pass  Total
mechanism algorithms | 3537   3537
┌ Warning: `sum(a::AbstractArray, dims)` is deprecated, use `sum(a, dims=dims)` instead.
│   caller = RigidBodyDynamics.OdeIntegrators.ButcherTableau(::Array{Float64,2}, ::Array{Float64,1}) at ode_integrators.jl:36
└ @ RigidBodyDynamics.OdeIntegrators ode_integrators.jl:36
Test Summary: | Pass  Total
simulation    |  506    506
┌ Warning: `full(A::Symmetric)` (and `full` in general) has been deprecated. To replace `full(A::Symmetric)`, as appropriate consider `Matrix(A)`, `Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copyto!(similar(parent(A)), A)`, or `LinearAlgebra.copytri!(copy(parent(A)), A.uplo)`.
│   caller = dynamics_solve!(::DynamicsResult{ForwardDiff.Dual{Nothing,Float64,0},Float64}, ::RigidBodyDynamics.CustomCollections.ConstVector{ForwardDiff.Dual{Nothing,Float64,0}}) at mechanism_algorithms.jl:699
└ @ RigidBodyDynamics mechanism_algorithms.jl:699
Test Summary:          | Pass  Total
mechanism modification | 1358   1358
Test Summary: | Pass  Total
pd            |  208    208
┌ Warning: `nbinclude(path)` is deprecated, use `@nbinclude(path)` instead.
│   caller = ip:0x0
└ @ Core :-1
WARNING: importing deprecated binding Base.srand into ##376.
WARNING: Base.srand is deprecated: it has been moved to the standard library package `Random`.
Add `using Random` to your imports.
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Derivatives and gradients using ForwardDiff.ipynb:In[1]:4
WARNING: importing deprecated binding Base.rand! into ##376.
WARNING: Base.rand! is deprecated: it has been moved to the standard library package `Random`.
Add `using Random` to your imports.
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Derivatives and gradients using ForwardDiff.ipynb:In[3]:2
WARNING: Base.median is deprecated: it has been moved to the standard library package `Statistics`.
Add `using Statistics` to your imports.
  likely near /Users/twan/.julia/packages/BenchmarkTools/1cAj/src/trials.jl:121
WARNING: Base.mean is deprecated: it has been moved to the standard library package `Statistics`.
Add `using Statistics` to your imports.
  likely near /Users/twan/.julia/packages/BenchmarkTools/1cAj/src/trials.jl:122
WARNING: Base.mean is deprecated: it has been moved to the standard library package `Statistics`.
Add `using Statistics` to your imports.
  likely near /Users/twan/.julia/packages/BenchmarkTools/1cAj/src/groups.jl:79
WARNING: Base.median is deprecated: it has been moved to the standard library package `Statistics`.
Add `using Statistics` to your imports.
  likely near /Users/twan/.julia/packages/BenchmarkTools/1cAj/src/groups.jl:80
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_positions(::Mechanism{Float64}) at mechanism.jl:117
└ @ RigidBodyDynamics mechanism.jl:117
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_velocities(::Mechanism{Float64}) at mechanism.jl:124
└ @ RigidBodyDynamics mechanism.jl:124
┌ Warning: `mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead
│   caller = num_constraints(::Mechanism{Float64}) at mechanism.jl:131
└ @ RigidBodyDynamics mechanism.jl:131
┌ Warning: `copy!(dst::AbstractArray, src::AbstractArray)` is deprecated. You can either use `copyto!(dst, src)` or `Future.copy!(dst, src)` instead.
│   caller = mom!(::Array{Float64,1}, ::SegmentedVector{JointID,Float64,Base.OneTo{JointID},Array{Float64,1}}) at Derivatives and gradients using ForwardDiff.ipynb:In[13]:11
└ @ Main.##376 Derivatives and gradients using ForwardDiff.ipynb:In[13]:11
┌ Warning: `copy!(dst::AbstractArray, src::AbstractArray)` is deprecated. You can either use `copyto!(dst, src)` or `Future.copy!(dst, src)` instead.
│   caller = mom!(::Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##376.mom!),Float64},Float64,2},1}, ::SegmentedVector{JointID,ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##376.mom!),Float64},Float64,2},Base.OneTo{JointID},Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.##376.mom!),Float64},Float64,2},1}}) at Derivatives and gradients using ForwardDiff.ipynb:In[13]:11
└ @ Main.##376 Derivatives and gradients using ForwardDiff.ipynb:In[13]:11
Test Summary:                               | Pass  Total
Derivatives and gradients using ForwardDiff |    6      6
WARNING: importing deprecated binding Base.eye into ##402.
WARNING: Base.eye is deprecated: it has been moved to the standard library package `LinearAlgebra`.
Add `using LinearAlgebra` to your imports.
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Four-bar linkage - simulation and visualization.ipynb:In[4]:5
┌ Warning: `sum(a::AbstractArray, dims)` is deprecated, use `sum(a, dims=dims)` instead.
│   caller = ButcherTableau(::Array{Float64,2}, ::Array{Float64,1}) at ode_integrators.jl:36
└ @ RigidBodyDynamics.OdeIntegrators ode_integrators.jl:36
Test Summary:                                   |
Four-bar linkage - simulation and visualization | No tests
WARNING: importing deprecated binding Base.srand into ##403.
WARNING: Base.srand is deprecated: it has been moved to the standard library package `Random`.
Add `using Random` to your imports.
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Jacobian_IK_and_Control.ipynb:In[1]:5
WARNING: importing deprecated binding Base.Pkg into ##403.
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Jacobian_IK_and_Control.ipynb:In[2]:1
┌ Warning: Pkg.dir is only kept for legacy CI script reasons
└ @ Pkg.API API.jl:432
WARNING: importing deprecated binding Base.rand! into ##403.
WARNING: Base.rand! is deprecated: it has been moved to the standard library package `Random`.
Add `using Random` to your imports.
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Jacobian_IK_and_Control.ipynb:In[7]:1
┌ Warning: Deprecated syntax `implicit assignment to global variable `desired``.
│ Use `global desired` instead.
└ @ none:0
┌ Warning: `linspace(start, stop, length::Integer)` is deprecated, use `range(start, stop=stop, length=length)` instead.
│   caller = top-level scope at none:0 [inlined]
└ @ Core none:0
Test Summary:           |
Jacobian_IK_and_Control | No tests
┌ Warning: The postfix .' syntax is deprecated. For vector v in v.', use transpose(v) instead. For matrix A in A.', use copy(transpose(A)) instead, unless A.' appears as an argument of *, / or \. In those cases, use transpose(A) instead. 
└ @ none:0
WARNING: importing deprecated binding Base.eye into ##404.
WARNING: Base.eye is deprecated: it has been moved to the standard library package `LinearAlgebra`.
Add `using LinearAlgebra` to your imports.
  likely near /Users/twan/.julia/dev/RigidBodyDynamics/notebooks/Quickstart - double pendulum.ipynb:In[6]:1
┌ Warning: The postfix .' syntax is deprecated. For vector v in v.', use transpose(v) instead. For matrix A in A.', use copy(transpose(A)) instead, unless A.' appears as an argument of *, / or \. In those cases, use transpose(A) instead. 
└ @ none:0
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│   caller = top-level scope at none:0
└ @ Core none:0
┌ Warning: using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= x` instead.
│   caller = top-level scope at none:0
└ @ Core none:0
Test Summary:                |
Quickstart - double pendulum | No tests

This is with the following manifest:

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinDeps]]
deps = ["Compat", "Libdl", "SHA", "URIParser"]
git-tree-sha1 = "160d5d926e83e0970dd549ad9fe0ac3e8107e83c"
uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
version = "0.8.8"

[[BufferedStreams]]
deps = ["Compat", "Pkg", "Test"]
git-tree-sha1 = "260922227fa4affdce57c59063fabf33a324d50e"
uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
version = "0.4.0"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "f3e87ca1e2df8e1e4f82ea504fddf0b9b0894f61"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "0.69.0"

[[Dates]]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[DocStringExtensions]]
deps = ["Compat"]
git-tree-sha1 = "0e9a957a5c1cc5d06e54aab3b8b9c4c495253269"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.4.4"

[[HTTPClient]]
deps = ["Compat", "LibCURL"]
git-tree-sha1 = "161d5776ae8e585ac0b8c20fb81f17ab755b3671"
uuid = "0862f596-cf2d-50af-8ef4-f2be67dfa83f"
version = "0.2.1"

[[InteractiveUtils]]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[LibCURL]]
deps = ["BinDeps", "Compat", "Libdl", "WinRPM"]
git-tree-sha1 = "9b431bc66757ad5124f4d206c319996a2dfa2662"
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
version = "0.2.2"

[[LibExpat]]
deps = ["Compat"]
git-tree-sha1 = "8ba2ca1635ec1755bcf1432c9a2aa6c91a3fb4fd"
uuid = "522f3ed2-3f36-55e3-b6df-e94fee9b0c07"
version = "0.4.2"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Libz]]
deps = ["BufferedStreams", "Compat"]
git-tree-sha1 = "501a8a5b0c500c3a04adb65a3468e3de5ad4e0d9"
uuid = "2ec943e9-cfe8-584d-b93d-64dcb6d567b7"
version = "0.2.4"

[[LightXML]]
deps = ["Compat", "WinRPM"]
path = "/Users/twan/.julia/dev/LightXML"
uuid = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
version = "0.6.0+"

[[LinearAlgebra]]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[LoopThrottle]]
git-tree-sha1 = "cf6f199986d2086f342345410aa27a46a0274b0f"
uuid = "39f5be34-8529-5463-bac7-bf6867c840a3"
version = "0.0.1"

[[Markdown]]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Nullables]]
deps = ["Compat"]
git-tree-sha1 = "23258f849603ad4fed3ce7dbcb8c0658920fa5ef"
uuid = "4d1e1d77-625e-5b40-9113-a560ec7a8ecd"
version = "0.0.5"

[[Pkg]]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Reexport]]
git-tree-sha1 = "caba582b2e9ef39b9cfff911aa13c5ca1b9a9896"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "0.1.0"

[[RigidBodyDynamics]]
deps = ["Compat", "DocStringExtensions", "LightXML", "LoopThrottle", "Nullables", "Reexport", "Rotations", "StaticArrays", "TypeSortedCollections"]
path = "/Users/twan/.julia/dev/RigidBodyDynamics"
uuid = "366cf18f-59d5-5db9-a4de-86a9f6786172"
version = "0.6.1+"

[[Rotations]]
deps = ["Compat", "StaticArrays"]
path = "/Users/twan/.julia/dev/Rotations"
uuid = "6038ab10-8711-5258-84ad-4b1120ba62dc"
version = "0.7.0+"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[StaticArrays]]
deps = ["InteractiveUtils", "LinearAlgebra", "Random", "Statistics", "Test"]
git-tree-sha1 = "acc0208265c71e22f90c83bbd3d92d7a3bc0ea6f"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.8.0"

[[Statistics]]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[TypeSortedCollections]]
deps = ["Compat"]
path = "/Users/twan/.julia/dev/TypeSortedCollections"
uuid = "94a5cd58-49a0-5741-bd07-fa4f4be8babf"
version = "0.4.2+"

[[URIParser]]
deps = ["Compat", "Unicode"]
git-tree-sha1 = "0f9c5e2d14e03fbd00696f9394e288bdd5adacbc"
uuid = "30578b45-9adc-5946-b283-645ec420af67"
version = "0.3.1"

[[UUIDs]]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[WinRPM]]
deps = ["BinDeps", "Compat", "HTTPClient", "LibExpat", "Libdl", "Libz", "SHA", "URIParser"]
git-tree-sha1 = "43730fcfe2f4921e7cfe1c21a6fdfeabb7ee4d74"
uuid = "c17dfb99-b4f7-5aad-8812-456da1ad7187"
version = "0.3.2"
tkoolen commented 6 years ago

Done.