[ros-users] [Discourse.ros.org] [ROS Projects] Tractobots, my attempts at field robots

Brian Tischler ros.discourse at gmail.com
Sun Apr 2 05:26:16 UTC 2017

In terms of position of your hitch etc, most robots are no where as large as the project you have here so there are a couple considerations.

1. You need a pivot distance, ie the distance from the back wheels (pivot point) to your antenna. your heading will be based off the movement of the antenna and since your antenna is not on the pivot point of your vehicle, the antenna will sweep in an arc and circle that is larger than your pivot point arc. 

2. The hitch point of your vehicle should be based on the distance from your pivot point to the hitch pin. In your tractor example note that the hitch moves in the opposite direction as your antenna.

Some example code to easily determine position based on your antenna heading in UTM...

               //translate world to the pivot axle
            pivotAxleEasting = pn.easting - (Math.Sin(fixHeading) * vehicle.antennaPivot);
            pivotAxleNorthing = pn.northing - (Math.Cos(fixHeading) * vehicle.antennaPivot);

            //determine where the rigid vehicle hitch ends
            hitchEasting = pn.easting + (Math.Sin(fixHeading) * (vehicle.hitchLength - vehicle.antennaPivot));
            hitchNorthing = pn.northing + (Math.Cos(fixHeading) * (vehicle.hitchLength - vehicle.antennaPivot));

3. the resulting angle of trailing equipment and its position is based on a following algorithm, like a trailer behind a truck. Its a constantly decaying angle as the pulling vehicle moves forward. The trailing hitch length needs to be known of course, and once the heading of your implement is known and since you know the width of your implement you can now know where the extremes of your implement are by using the above sin/cos method.

Some example code

                    double t = (vehicle.toolTrailingHitchLength) / distanceCurrentStepFix;
                    toolEasting = hitchEasting + t * (hitchEasting - toolEasting);
                    toolNorthing = hitchNorthing + t * (hitchNorthing - toolNorthing);
                    fixHeadingImplement = Math.Atan2(hitchEasting - toolEasting, hitchNorthing - toolNorthing);    

Again, while its in C#, easily translated to your required code. 

Hope this helps your quest.

[Visit Topic](https://discourse.ros.org/t/tractobots-my-attempts-at-field-robots/1486/20) or reply to this email to respond.

More information about the ros-users mailing list