How to Set the force mode as torque here

57 views
Skip to first unread message

Aswath Narayanan R.R.B na20b009

unread,
May 25, 2022, 10:50:24 PM5/25/22
to ProjectChrono
I am attaching my code fragment. I want to set the ForceType as Torque.

T = chrono.ChForce()
T.SetMode(ForceType_TORQUE)

But this is throwing me error, pl help

JASON Z

unread,
May 25, 2022, 11:48:55 PM5/25/22
to ProjectChrono
Hi,

Could you please paste the error message in the discussion thread?

Thanks

JASON Z

unread,
May 26, 2022, 1:44:38 AM5/26/22
to ProjectChrono
Please keep one question in one thread. So posting replies in this thread only. Thanks
Refer to page

You didn’t declare your m_mode variable, how can the function recognize it?

You should parse in either FORCE or TORQUE only

Radu Serban

unread,
May 29, 2022, 9:29:03 AM5/29/22
to ProjectChrono

Aswath,

 

The correct syntax is:

T.SetMode(chrono.ChForce.TORQUE)

 

I realize that using enums in the Python code is a bit confusing.  Part of the issue is the fact that the underlying C++ code sometimes uses classical enums and sometimes strongly typed enums (and the Python wrapping needs to deal differently with the latter).

 

On a different note, please use a single email thread when discussing the same topic to make things easier to follow.

 

--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/621abcf9-3f03-4532-94bc-f48c338ae1d8n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages