Skip to content

Commit

Permalink
fix: replace old-style type access with the new style
Browse files Browse the repository at this point in the history
  • Loading branch information
doudou committed Dec 3, 2021
1 parent d1a467c commit 4f40427
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 35 deletions.
27 changes: 14 additions & 13 deletions test/test_thruster_feedback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
sample = thrusters_feedback.cmd_in.new_sample

# 3 thrusters inputs were sent and 2 are expected
thruster = Types::Base::JointState.new
thruster = Types.base.JointState.zero
thruster.effort = 3
sample.elements = [thruster, thruster, thruster]
cmd_in.write sample
Expand All @@ -115,7 +115,7 @@
sample = thrusters_feedback.cmd_in.new_sample

# the effort field was not set
thruster = Types::Base::JointState.new
thruster = Types.base.JointState.zero
sample.elements = [thruster, thruster]
cmd_in.write sample

Expand All @@ -131,9 +131,9 @@
thrusters_feedback.start

sample = thrusters_feedback.cmd_in.new_sample
thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new

thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.speed = 457
thruster2.speed = 789
sample.elements = [thruster1, thruster2]
Expand All @@ -156,9 +156,9 @@
thrusters_feedback.start

sample = thrusters_feedback.cmd_in.new_sample
thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new

thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.speed = -530
thruster2.speed = -650
sample.elements = [thruster1, thruster2]
Expand All @@ -180,9 +180,9 @@
thrusters_feedback.start

sample = thrusters_feedback.cmd_in.new_sample
thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new

thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.raw = 25
thruster2.raw = 17
sample.elements = [thruster1, thruster2]
Expand All @@ -204,8 +204,9 @@
thrusters_feedback.start

sample = thrusters_feedback.cmd_in.new_sample
thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new

thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.raw = -49
thruster2.raw = -31
sample.elements = [thruster1, thruster2]
Expand Down
26 changes: 13 additions & 13 deletions test/test_thruster_force_2_body_effort.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
thruster_force_2_body_effort.start

sample = thruster_force_2_body_effort.thruster_forces.new_sample
thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new
thruster3 = Types::Base::JointState.new
thruster4 = Types::Base::JointState.new
thruster5 = Types::Base::JointState.new
thruster6 = Types::Base::JointState.new

thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster3 = Types.base.JointState.zero
thruster4 = Types.base.JointState.zero
thruster5 = Types.base.JointState.zero
thruster6 = Types.base.JointState.zero
thruster1.effort = 30
thruster2.effort = 30
thruster3.effort = 0
Expand Down Expand Up @@ -53,12 +53,12 @@

sample = thruster_force_2_body_effort.thruster_forces.new_sample

thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new
thruster3 = Types::Base::JointState.new
thruster4 = Types::Base::JointState.new
thruster5 = Types::Base::JointState.new
thruster6 = Types::Base::JointState.new
thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster3 = Types.base.JointState.zero
thruster4 = Types.base.JointState.zero
thruster5 = Types.base.JointState.zero
thruster6 = Types.base.JointState.zero
thruster1.effort = 0
thruster2.effort = 0
thruster3.effort = 25
Expand Down
18 changes: 9 additions & 9 deletions test/test_thruster_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
sample = thrusters_input.cmd_in.new_sample

# the effort field was not set
thruster = Types::Base::JointState.new
thruster = Types.base.JointState.zero
sample.elements = [thruster, thruster]
cmd_in.write sample

Expand All @@ -132,8 +132,8 @@

sample = thrusters_input.cmd_in.new_sample

thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new
thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.effort = 37
thruster2.effort = 43
sample.elements = [thruster1, thruster2]
Expand All @@ -157,8 +157,8 @@

sample = thrusters_input.cmd_in.new_sample

thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new
thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.effort = -15
thruster2.effort = -7
sample.elements = [thruster1, thruster2]
Expand All @@ -181,8 +181,8 @@

sample = thrusters_input.cmd_in.new_sample

thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new
thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.effort = 17
thruster2.effort = 3
sample.elements = [thruster1, thruster2]
Expand All @@ -205,8 +205,8 @@

sample = thrusters_input.cmd_in.new_sample

thruster1 = Types::Base::JointState.new
thruster2 = Types::Base::JointState.new
thruster1 = Types.base.JointState.zero
thruster2 = Types.base.JointState.zero
thruster1.effort = -49
thruster2.effort = -31
sample.elements = [thruster1, thruster2]
Expand Down

0 comments on commit 4f40427

Please sign in to comment.