Skip to content

Feature/stop behavior#23

Open
d-cahill23 wants to merge 58 commits intomasterfrom
feature/stop_behavior
Open

Feature/stop behavior#23
d-cahill23 wants to merge 58 commits intomasterfrom
feature/stop_behavior

Conversation

@d-cahill23
Copy link
Copy Markdown
Collaborator

Pull request to look over stop behavior and multiplexor code

d-cahill23 added 30 commits July 2, 2021 16:03
I copied some code from the pure pursuit package that may be helpful for this code.
Right now the I just subtracted 1 meter per second every second until the car got to zero meters per seconds.  I will now try to implement the math to get the car to stop at an incoming stop point
- Changed the math that stops the car.  Made it so the distance is updated every second
- Got rid of the while loop and are now using a timer to update when stop_the car method runs
Changed it back so that the code only uses the initial distance to the sign with constant acceleration
Planning on meeting with Prof. Vasile to work through the issues
It was just a math mistake where I wasn't updating the the velo correctly
and so that the acceleration stays constant.  It seems to work since the car hits zero at about the time the car reaches the right distance
Also added to the yaml file and launch file
@d-cahill23 d-cahill23 requested review from declanCoster and wasserfeder and removed request for declanCoster and wasserfeder August 2, 2021 17:39
<arg name="pkg_name" value="multiplexor" doc="name of the package"/>
<arg name="node_name" default="multiplexor" doc="name of the node"/>
<arg name="node_type" default="multiplexor_node.py" doc="name of the type"/>
<arg name="output" default="screen" doc="output display"/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add another arg that could be a boolean if the multiplexor should be working or just passing the speed command messages with no changes. (Kinda like a multiplexor on/off input) [this will probably require more code in the actual node]

'''
if self.new_sign == True and self.sign_type == "stop":
self.vehicle_command_pub.publish(self.stop_message)
print("sending stop_behavior commands")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for all the uses of print in the actual nodes, but use rospy.logdebug instead. (http://wiki.ros.org/rospy/Overview/Logging) this is an example : https://github.com/erl-lehigh/MTSE/blob/master/navigation/purepursuit/scripts/purepursuit_node.py#L211

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched all the logging and printing to rospy.logdebug on the multiplexor code but for some reason when I switched them over in the stop_behavior_node.py it broke the code so I kept those as the way I had them for now

msg.speed,
msg.steering_angle)
self.command_pub.publish(msg)
#rospy.loginfo(msg) #######just to help dan with his code for now
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just delete this before the pr

#update distance and speed
self.current_distance = self.current_distance - (((self.current_speed + self.msg.speed) / 2)*(self.period.to_sec())) #current_velo in this equation is actually the previous speed
self.current_speed = self.msg.speed
rospy.loginfo('SLOWING DOWN! %2.5s m/s Acc = %2.5s m/s^2, Dist = %2.5s ', self.msg.speed, self.acceleration, self.current_distance)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also change these to .logdebug

@@ -0,0 +1 @@
#Hi No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants