Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment 1: Simple movement Required Implement and test the simple movement update algorithms (both HS and NE1) shown on p. 49 of [Millington, 2019].

image text in transcribed

image text in transcribed

Programming Assignment 1: Simple movement Required Implement and test the simple movement update algorithms (both HS and NE1) shown on p. 49 of [Millington, 2019]. Run your program for 100 simulated seconds for each of four different movement trajectories: 1.At= 0.50 and Newton-Euler-1 integration 2.At= 0.50 and High School physics 3.At= 0.25 and Newton-Euler-1 integration 4.At= 0.25 and High School physics Output each generated trajectory as a CSV file with each record containing the following ten fields. Output a record for the initial conditions (time = 0) and for each subsequent time step, up to and including the last time step (time = 100): 1.time (seconds) 2.position x (meters) 3.position z (meters) 4.velocity x (meters per second) 5.velocity z (meters per second) 6. linear acceleration x (meters per second per second) 7. linear acceleration z (meters per second per second) 8. orientation (radians) 9. rotation (radians per second) 10. angular acceleration (radians per second per second) Your objective is to replicate, as closely as possible, the movement update example plots on slides 3.22 and 3.23. Your program should: 1.Be written in C++, Java, or Python 2. Output a text file containing all of the trajectory data variables 3. Be written with reasonable attention to code quality and include comments class Kinematic: # ... Member data as before ... class Kinematic: position: Vector orientation: float velocity: Vector rotation: float function update steering: SteeringOutput, time: float): # Update the position and orientation. half_t_sq: float = 0.5 * time * time position += velocity * time + steering. linear * half_t_sq orientation += rotation * time + steering. angular * half_t_sq # and the velocity and rotation. velocity += steering. linear * time rotation += steering. angular * time tions for motion. If the frame rate is high, then the update time passed to this function is likely to be very small. The square on and orientation will be tiny. It is more common to see these terms removed from the update algorithm, to give what's these kinematic data. They return acceleratic class Kinematic: ... Member data as before ... class SteeringOutput: linear: Vector angular: float function update steering: SteeringOutput, time: float): # Update the position and orientation. position += velocity * time orientation += rotation * time # and the velocity and rotation. velocity += steering. linear * time rotation += steering. angular * time Updating position and orientation (1 of 2) "High School" physics; acceleration during time step included class Kinematic: position: Vector # 2D or 3D vector orientation: float # single floating point value velocity: Vector # 2D or 3D vector rotation: float # single floating point value class SteeringOutput: linear: Vector # 2D or 3D vector angular: float # single floating point value function update (steering: Steeringoutput, time: float) # Update the position and orientation half_t_sq: float = 0.5 * time * time position += velocity * time + steering.linear * half_t_sq orientation += rotation * time + steering. angular * half_t_sq # Update the velocity and rotation velocity += steering. linear * time rotation += steering. angular * time Updating position and orientation (2 of 2) Newton-Euler-1; acceleration during time step not included class Kinematic: position: Vector # 2D or 3D vector orientation: float # single floating point value velocity: Vector # 2D or 3D vector rotation: float # single floating point value class SteeringOutput: linear: Vector # 2D or 3D vector angular: float # single floating point value function update(steering, time) # Update the position and orientation position += velocity * time orientation += rotation * time # Update the velocity and rotation velocity += steering.linear * time rotation += steering. angular * time Programming Assignment 1: Simple movement Required Implement and test the simple movement update algorithms (both HS and NE1) shown on p. 49 of [Millington, 2019]. Run your program for 100 simulated seconds for each of four different movement trajectories: 1.At= 0.50 and Newton-Euler-1 integration 2.At= 0.50 and High School physics 3.At= 0.25 and Newton-Euler-1 integration 4.At= 0.25 and High School physics Output each generated trajectory as a CSV file with each record containing the following ten fields. Output a record for the initial conditions (time = 0) and for each subsequent time step, up to and including the last time step (time = 100): 1.time (seconds) 2.position x (meters) 3.position z (meters) 4.velocity x (meters per second) 5.velocity z (meters per second) 6. linear acceleration x (meters per second per second) 7. linear acceleration z (meters per second per second) 8. orientation (radians) 9. rotation (radians per second) 10. angular acceleration (radians per second per second) Your objective is to replicate, as closely as possible, the movement update example plots on slides 3.22 and 3.23. Your program should: 1.Be written in C++, Java, or Python 2. Output a text file containing all of the trajectory data variables 3. Be written with reasonable attention to code quality and include comments class Kinematic: # ... Member data as before ... class Kinematic: position: Vector orientation: float velocity: Vector rotation: float function update steering: SteeringOutput, time: float): # Update the position and orientation. half_t_sq: float = 0.5 * time * time position += velocity * time + steering. linear * half_t_sq orientation += rotation * time + steering. angular * half_t_sq # and the velocity and rotation. velocity += steering. linear * time rotation += steering. angular * time tions for motion. If the frame rate is high, then the update time passed to this function is likely to be very small. The square on and orientation will be tiny. It is more common to see these terms removed from the update algorithm, to give what's these kinematic data. They return acceleratic class Kinematic: ... Member data as before ... class SteeringOutput: linear: Vector angular: float function update steering: SteeringOutput, time: float): # Update the position and orientation. position += velocity * time orientation += rotation * time # and the velocity and rotation. velocity += steering. linear * time rotation += steering. angular * time Updating position and orientation (1 of 2) "High School" physics; acceleration during time step included class Kinematic: position: Vector # 2D or 3D vector orientation: float # single floating point value velocity: Vector # 2D or 3D vector rotation: float # single floating point value class SteeringOutput: linear: Vector # 2D or 3D vector angular: float # single floating point value function update (steering: Steeringoutput, time: float) # Update the position and orientation half_t_sq: float = 0.5 * time * time position += velocity * time + steering.linear * half_t_sq orientation += rotation * time + steering. angular * half_t_sq # Update the velocity and rotation velocity += steering. linear * time rotation += steering. angular * time Updating position and orientation (2 of 2) Newton-Euler-1; acceleration during time step not included class Kinematic: position: Vector # 2D or 3D vector orientation: float # single floating point value velocity: Vector # 2D or 3D vector rotation: float # single floating point value class SteeringOutput: linear: Vector # 2D or 3D vector angular: float # single floating point value function update(steering, time) # Update the position and orientation position += velocity * time orientation += rotation * time # Update the velocity and rotation velocity += steering.linear * time rotation += steering. angular * time

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions