Skip to content

[RSDK-14024] When cgo is present use trajex for the simulated arm#6042

Draft
acmorrow wants to merge 1 commit into
viamrobotics:mainfrom
acmorrow:RSDK-14024-use-trajex-in-sim-arm
Draft

[RSDK-14024] When cgo is present use trajex for the simulated arm#6042
acmorrow wants to merge 1 commit into
viamrobotics:mainfrom
acmorrow:RSDK-14024-use-trajex-in-sim-arm

Conversation

@acmorrow
Copy link
Copy Markdown
Member

@acmorrow acmorrow commented May 26, 2026

@dgottlieb - Opening this as a draft, for discussion and for you to be able to do local testing, not proposing that we merge it just yet.

This change demonstrates using trajex in the simulated arm by way of the trajex go bindings (viam-modules/trajex#15) and C api (viam-modules/trajex#14).

To build against this, you will need to:

  1. Clone https://github.com/viam-modules/trajex somewhere local and change directories into the new clone
  2. Configure (e.g. cmake -B build -S . -G Ninja) and build (e.g. cmake --build build --target all) the trajex libraries. Note that you must call the build directory build, and it must be at the root of the trajex tree.
  3. Replace the RDK reference to trajex with the relative path from RDK to your local copy, with go mod edit -replace github.com/viam-modules/trajex=../trajex (update the replacement path as needed).

You should now be able to build and test the simulated arm using trajex: go test -count=1 ./components/arm/sim/...

If everything worked right, it should compile and link and you should be using the new trajectory generator.

Note that I'm still testing this, but I wanted to let you have an early look in case you had any feedback on the shape of things. I'll let you know once I'm happy with it, and then you should be able to experiment with invoking it from motion.

If we decide this is the right direction, then we can start figuring out what our production build and release story ought to look like.

@acmorrow acmorrow requested a review from dgottlieb May 26, 2026 21:18
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label May 26, 2026
@acmorrow acmorrow requested a review from npmenard May 26, 2026 21:21
@acmorrow
Copy link
Copy Markdown
Member Author

@dgottlieb - Forgot to mention that if you want a smaller faster build for trajex, you can add -DVIAM_TRAJEX_BUILD_TESTS=OFF -DVIAM_TRAJEX_ENABLE_LEGACY=OFF -DVIAM_TRAJEX_ENABLE_TOOLS=OFF -DVIAM_TRAJEX_ENABLE_SERVICE=OFF -DBUILD_SHARED_LIBS=ON to the first cmake (the generation step) above.

Copy link
Copy Markdown
Member

@dgottlieb dgottlieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has all the right stuff. High level preference is to align with the upcoming arm API proposal and ideally instrument simarm with trajex for convenient comparison, but also let be able to control it without going through trajex. And not needing to wait for a config change observe that comparison. More detail on a random line of code.

Comment thread components/arm/sim/sim.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants