hnqiu/ros-ethz

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:

  1. 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.
  2. 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".
  3. 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 :)

hnqiu commented

Hi Javad,
Glad to know my code is useful to you and thanks for the comments.

  1. It's a good idea to use a P-controller for x-vel. I will add the component a bit later.
  2. Actually we need pillar_pos to be used to update the marker position in vizPillar() at every step, because initPillarMarker() is only called during initialization. Please note pillar_pos is the relative position to the robot and is updated in the laser callback function.
  3. 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 msgwill 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

hnqiu commented

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 call spinOnce().

Cheers,
hnqiu

hnqiu commented

Hi Javad, I've updated the x-vel control in course 3 using a P controller. Thanks for opening the issue.

Cheers,
hnqiu