Conversation
I copied some code from the pure pursuit package that may be helpful for this code.
This might put the README file back
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
| <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"/> |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
also change these to .logdebug
| @@ -0,0 +1 @@ | |||
| #Hi No newline at end of file | |||
Pull request to look over stop behavior and multiplexor code