I have a question about "void getLocation" when using the Chrono vehicle

51 views
Skip to first unread message

马浩楠

unread,
Sep 20, 2023, 3:04:53 AM9/20/23
to ProjectChrono
I want to add a "UCA_UF" to the enum PointId in ChDoubleWishbone.h, which means "Location Upright Front". 
What I want to know is that in "Initialize", I need to calculate the position of "UCA_UF". Is it possible to do this using getLocation, or do we need to calculate it manually?

Radu Serban

unread,
Sep 21, 2023, 3:39:02 AM9/21/23
to ProjectChrono

Hello,

 

You did not receive yet an answer because your question was not well formulated. You are asking about “creating a new suspension in ChDoubleWishbone”. That does not make sense, given how the Chrono::Vehicle is designed and what the meaning of a subsystem template is.  You may want to consult the online documentation (https://api.projectchrono.org/manual_vehicle.html) and/or the paper (https://projectchrono.org/assets/white_papers/chronoVehicle_IJVP.pdf) to familiarize yourself with the architecture and design of Chrono::Vehicle. You will then understand that each subsystem template imposes a given topology of the mechanical system for that particular subsystem. This means a specific number of bodies, joints, and force elements and a fixed connectivity between these. The hardpoints that are part of the definition of a given subsystem (in this case the double wishbone suspension subsystem implemented in ChDoubleWishbone) are therefore the complete set that is needed to specify this topology. 

 

Therefore, the question is why you want to add a new hardpoint. I doubt it is just for monitoring a location on a particular body of that type of suspension (if that is the case, you can simply get a handle to that body by its name and then invoke an appropriate Chrono API function to get the absolute location of some point specified through its local position on that body).  Instead, I suspect you want to use that point to add some other modeling component to the suspension subsystem. If that is the case, that will not be a ChDoubleWishbone suspension, but rather a new suspension template (like the many we already have in Chrono::Vehicle, each one of them with a different topology).

 

Creating a new vehicle subsystem template requires adding new files to the Chrono code base and modifying some others so that the new subsystem type becomes available for use in vehicle models. That’s obviously not a simple task and requires a deeper understanding of the code. 

Alternatively, only for wheeled vehicle suspension, I recently added a “generic” template which allows a user to construct a new suspension topology by specifying (in a derived class or else through a JSON file) an arbitrary number of bodies, joints, force elements, etc. as well as their connectivity.  As I said above, I am not absolutely clear on what you are trying to achieve, but if what you want is your own custom suspension subsystem, this is the route I suggest for you.

 

This “generic” template is named ChGenericWheeledSuspension and the derived class that can build one from a JSON specification is implemented in GenericWheeledSuspension.  There are two JSON samples to illustrate how you can use this mechanism for constructing your own, custom suspension:

These two samples are for illustration only, as they simply replicate already existing suspension templates. But you could now modify any of them, e.g., by adding new bodies, or additional springs, etc, and get a completely new suspension topology.  Since you seem interested in a slightly modified double wishbone suspension, you should probably start from the 1st one I listed above.

 

You can read more about this new mechanism for creating a generic suspension topology in the Chrono ChangeLog file.

 

Best,
Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/b3fb67bc-5492-4331-aee1-0e94e675d419n%40googlegroups.com.

马浩楠

unread,
Sep 21, 2023, 4:01:23 AM9/21/23
to ProjectChrono
Thanks for your answer. Sorry for the problem with my expression. My purpose is to add a hardpoint, and the two links of the lower control arm become a whole. I'm hoping to create a new suspension to use. You said that it is feasible to implement a new suspension through "ChGenericWheeledSuspension", right?
图片1.png
What I want to do is add a connection point where the two lower control arm links each become one piece. Add another lower control arm to the existing lower control arm, and the connection points between the two independent lower control arms, the chassis and the steering knuckle are all at one point QQ图片20230921160039.png

Radu Serban

unread,
Sep 21, 2023, 4:51:29 AM9/21/23
to ProjectChrono

I’m not sure I understand what you want to do, so maybe the following may be a complete misinterpretation.  Please note that, in the existing ChDoubleWishbone template, there are not 2 separate bodies that make up the lower control arm! The lower control arm is a single rigid body, connected through a revolute joint to the chassis and with a spherical joint to the upright body. The two locations that you highlighted in the JSON specification file are used only for visualization purposes (the revolute joint that connects the arm to the chassis is created at the midpoint between these two locations). As you can see in the JSON file, both these points are under the “Lower Control Arm” which also specifies properties for only one body (mass, inertia, COM).

 

If you are thinking of something else (additional bodies and additional joints), maybe you can provide a schematic that shows these (similar to this one we have for the current template).  In any case, if you want to model a suspension with a topology different from the current one, then yes, use ChGenericWheeledSuspension as I suggested in my previous email.

 

--Radu

 

From: '马浩楠' via ProjectChrono <projec...@googlegroups.com>
Sent: Thursday, September 21, 2023 10:01 AM
To: ProjectChrono <projec...@googlegroups.com>
Subject: Re: [chrono] I have a question about "void getLocation" when using the Chrono vehicle

 

Thanks for your answer. Sorry for the problem with my expression. My purpose is to add a hardpoint, and the two links of the lower control arm become a whole. I'm hoping to create a new suspension to use. You said that it is feasible to implement a new suspension through "ChGenericWheeledSuspension", right?

What I want to do is add a connection point where the two lower control arm links each become one piece. Add another lower control arm to the existing lower control arm, and the connection points between the two independent lower control arms, the chassis and the steering knuckle are all at one point

马浩楠

unread,
Sep 21, 2023, 4:56:47 AM9/21/23
to ProjectChrono
Yes. What I want is a completely new suspension like the one I posted before. What I want to know is if I can use ChGenericWheeledSuspension to meet my needs of creating different suspensions. Even if the request is what I said before
Reply all
Reply to author
Forward
0 new messages