Course 3
Closed this issue · 4 comments
Hello,
Thanks for sharing your code for ETH ROS course. It was a great help.
However, I have some curiosities for your solution for course 3 that I declare one by one below:
setVel(3.0, "forward");
why here you didn't consider a P-controller for x-velocity? cause the robot won't stop when it reaches the target.- in the function "initPillarMarker()", the pillar_pose[0,1] are used and it doesn't make sense to reuse these two variables again in the function "vizPillar".
- In the constructor, I guess it would be better if we could put "initPillarMarker()" and "setVel" functions before subscribing to "/scan" topic.
I look forward to your feedback Hnqiu :)
Hi Javad,
Glad to know my code is useful to you and thanks for the comments.
- It's a good idea to use a P-controller for x-vel. I will add the component a bit later.
- Actually we need
pillar_pos
to be used to update the marker position invizPillar()
at every step, becauseinitPillarMarker()
is only called during initialization. Please notepillar_pos
is the relative position to the robot and is updated in the laser callback function. - I guess it wouldn't matter. Why would you suggest so?
Thanks,
hnqiu
Hi Hnqiu,
Thanks for the reply.
2. I agree with you, but I mean the first two line in vizPillar
is repeated in the initPillarMarker
. Isn't initPillarMarker
called in every function loop?
3. because the msg
will be send before seting the forward velocity. Thus, the current command for forward speed will be used in the next time step. Although cause the time increments is very low, it is not sensible, and the program works.
Kind regards,
Javad
Thanks Javad.
- No
initPillarMarker()
is only called once at initialization. - The msg will only be sent to the topic in
DriveHusky()
, which is called in the laser callback function, which is AFTER initialization. Note callback functions execute when we callspinOnce()
.
Cheers,
hnqiu
Hi Javad, I've updated the x-vel control in course 3 using a P controller. Thanks for opening the issue.
Cheers,
hnqiu