Spaces:
Running
Running
File size: 21,417 Bytes
5c85958 b05a944 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 b05a944 5c85958 b05a944 5c85958 b05a944 5c85958 b05a944 5c85958 b05a944 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 fcd0e24 5c85958 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 |
import { useState, useMemo } from 'react';
import {
Box,
Container,
Typography,
TextField,
InputAdornment,
Accordion,
AccordionSummary,
AccordionDetails,
Chip,
Stack,
IconButton,
Fade,
Button,
} from '@mui/material';
import SearchIcon from '@mui/icons-material/Search';
import CloseIcon from '@mui/icons-material/Close';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import rehypeHighlight from 'rehype-highlight';
import 'highlight.js/styles/github.css';
import Layout from '../components/Layout';
import PageHero from '../components/PageHero';
// FAQ Data
const faqSections = [
{
id: 'getting-started',
title: 'Getting Started',
items: [
{
question: 'How do I connect to Reachy Mini from Python?',
answer: `To control Reachy Mini, you mainly use the ReachyMini class from the reachy_mini package:
\`\`\`python
from reachy_mini import ReachyMini
with ReachyMini() as mini:
# your code here
...
\`\`\`
This connects to the Reachy Mini daemon and initializes motors and sensors.`,
tags: ['SDK', 'Python'],
},
{
question: 'Do I need to start the daemon manually?',
answer: `Yes. All examples assume you have already started the Reachy Mini daemon:
- Either via command line: \`reachy-mini-daemon\`
- Or via Python: \`reachy_mini.daemon.app.main\``,
tags: ['SDK'],
},
{
question: 'How long does assembly usually take?',
answer: 'Most testers report 1.5β2 hours, with some up to 4 hours depending on experience.',
tags: ['Hardware'],
},
{
question: "The dashboard at http://localhost:8000 doesn't work β what should I check?",
answer: `Typical checks:
1. You are using a proper Python virtual environment (.venv)
2. You installed/updated the Reachy Mini SDK: \`pip install -U reachy-mini\`
3. The daemon is running`,
tags: ['SDK'],
},
],
},
{
id: 'movement',
title: 'Moving the Robot',
items: [
{
question: "How do I move Reachy Mini's head to a specific pose?",
answer: `Use goto_target with a pose created by create_head_pose:
\`\`\`python
from reachy_mini import ReachyMini
from reachy_mini.utils import create_head_pose
with ReachyMini() as mini:
mini.goto_target(head=create_head_pose(y=-10, mm=True))
\`\`\``,
tags: ['Movement', 'SDK'],
},
{
question: "What's the difference between goto_target and set_target?",
answer: `**goto_target:** Interpolates motion over a duration (default 0.5s). Supports different interpolation methods (linear, minjerk, ease, cartoon). Ideal for smooth, timed motions.
**set_target:** Sets the target immediately, without interpolation. Suited for high-frequency control (e.g. sinusoidal trajectories, teleoperation).`,
tags: ['Movement', 'SDK'],
},
{
question: 'How do I move head, body, and antennas at the same time?',
answer: `Use goto_target with multiple named arguments:
\`\`\`python
mini.goto_target(
head=create_head_pose(y=-10, mm=True),
antennas=np.deg2rad([45, 45]),
duration=2.0,
body_yaw=np.deg2rad(30),
)
\`\`\``,
tags: ['Movement'],
},
],
},
{
id: 'apps',
title: 'Writing & Sharing Apps',
items: [
{
question: 'How do I write a Reachy Mini app?',
answer: `Inherit from ReachyMiniApp and implement run:
\`\`\`python
from reachy_mini.apps.app import ReachyMiniApp
from reachy_mini import ReachyMini
class MyApp(ReachyMiniApp):
def run(self, reachy_mini: ReachyMini, stop_event):
# your app logic
...
\`\`\``,
tags: ['SDK', 'Python'],
},
{
question: 'How can I generate a new app template quickly?',
answer: `Use the app template generator:
\`reachy-mini-make-app my_app_name\`
This creates a complete project structure with pyproject.toml, README.md, and the main app file.`,
tags: ['SDK'],
},
],
},
{
id: 'hardware',
title: 'Hardware & Motion Limits',
items: [
{
question: 'What are the safety limits of the head and body?',
answer: `Physical & software limits include:
- Body yaw: [-180Β°, 180Β°]
- Head pitch/roll: [-40Β°, 40Β°]
- Head yaw: [-180Β°, 180Β°]
- Difference (body_yaw - head_yaw): [-65Β°, 65Β°]
If you command a pose outside these limits, Reachy Mini will automatically clamp to the nearest safe pose.`,
tags: ['Hardware'],
},
],
},
{
id: 'sensors',
title: 'Sensors & Media',
items: [
{
question: 'How do I grab camera frames from Reachy Mini?',
answer: `Use the media object:
\`\`\`python
with ReachyMini() as mini:
frame = mini.media.get_frame()
# frame is a numpy array
\`\`\``,
tags: ['Vision', 'SDK'],
},
{
question: 'How do I access microphone audio samples?',
answer: `\`\`\`python
with ReachyMini() as mini:
sample = mini.media.get_audio_sample()
\`\`\``,
tags: ['Audio'],
},
],
},
{
id: 'motors',
title: 'Motors & Compliancy',
items: [
{
question: 'How do I enable, disable, or make motors compliant?',
answer: `Three main methods:
1. **enable_motors**: Powers motors ON. Robot holds position.
2. **disable_motors**: Powers motors OFF. Robot is limp.
3. **make_motors_compliant**: Motors ON but soft. Good for teaching-by-demonstration.`,
tags: ['Hardware', 'SDK'],
},
],
},
];
// Tag color - all primary
const tagColor = { bg: 'rgba(255, 149, 0, 0.1)', color: '#FF9500', border: 'rgba(255, 149, 0, 0.25)' };
// Extract all unique tags from FAQ data
const allTags = [...new Set(faqSections.flatMap((s) => s.items.flatMap((i) => i.tags)))].sort();
export default function FAQ() {
const [searchQuery, setSearchQuery] = useState('');
const [selectedTag, setSelectedTag] = useState(null);
// Filter FAQ items based on search and tag
const filteredSections = useMemo(() => {
const query = searchQuery.toLowerCase().trim();
return faqSections
.map((section) => ({
...section,
items: section.items.filter((item) => {
// Tag filter
if (selectedTag && !item.tags.includes(selectedTag)) {
return false;
}
// Search filter
if (query) {
return (
item.question.toLowerCase().includes(query) ||
item.answer.toLowerCase().includes(query) ||
item.tags.some((tag) => tag.toLowerCase().includes(query))
);
}
return true;
}),
}))
.filter((section) => section.items.length > 0);
}, [searchQuery, selectedTag]);
const totalResults = filteredSections.reduce((acc, section) => acc + section.items.length, 0);
const totalItems = faqSections.reduce((acc, section) => acc + section.items.length, 0);
const hasActiveFilter = searchQuery.trim() || selectedTag;
const handleTagClick = (tag) => {
setSelectedTag((prev) => (prev === tag ? null : tag));
};
const clearFilters = () => {
setSearchQuery('');
setSelectedTag(null);
};
return (
<Layout transparentHeader>
<PageHero
eyebrow="Help Center"
title="Frequently Asked Questions"
subtitle="Everything you need to know about Reachy Mini β from setup to advanced programming."
accentColor="#8b5cf6"
stickers={[
{ src: '/assets/reachies/explorer.png', size: 240, top: 20, right: 120, rotation: 8 },
{ src: '/assets/reachies/magician.png', size: 200, bottom: 0, left: 140, rotation: -10 },
]}
primitives={[
{ type: 'ring', color: '#8b5cf6', size: 80, top: 80, left: 200 },
{ type: 'squareOutline', color: '#ec4899', size: 60, bottom: 50, right: 180, rotation: 15 },
]}
/>
{/* Search + HuggingChat CTA */}
<Box
sx={{
position: 'sticky',
top: 64,
zIndex: 100,
backgroundColor: 'background.default',
py: 3,
borderBottom: '1px solid',
borderColor: 'divider',
}}
>
<Container maxWidth="md">
{/* Search + AI Button row */}
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={2} alignItems="stretch">
<TextField
fullWidth
placeholder="Search questions..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
InputProps={{
startAdornment: (
<InputAdornment position="start">
<SearchIcon color="action" />
</InputAdornment>
),
endAdornment: searchQuery && (
<InputAdornment position="end">
<IconButton size="small" onClick={() => setSearchQuery('')} edge="end">
<CloseIcon fontSize="small" />
</IconButton>
</InputAdornment>
),
}}
sx={{
'& .MuiOutlinedInput-root': {
borderRadius: 3,
},
}}
/>
{/* HuggingChat CTA Button */}
<Button
variant="outlined"
color="primary"
href="https://huggingface.co/chat/"
target="_blank"
startIcon={<Box sx={{ fontSize: 18 }}>π€</Box>}
endIcon={<OpenInNewIcon sx={{ fontSize: 16 }} />}
sx={{
flexShrink: 0,
px: 3,
fontWeight: 600,
fontSize: 14,
whiteSpace: 'nowrap',
borderRadius: 3,
}}
>
Ask AI
</Button>
</Stack>
{/* Tag filters */}
<Stack
direction="row"
spacing={1}
flexWrap="wrap"
useFlexGap
sx={{ mt: 2 }}
>
{allTags.map((tag) => (
<Chip
key={tag}
label={tag}
onClick={() => handleTagClick(tag)}
sx={{
cursor: 'pointer',
fontWeight: 600,
fontSize: 12,
transition: 'all 0.2s ease',
backgroundColor:
selectedTag === tag
? tagColor.color
: tagColor.bg,
color:
selectedTag === tag
? 'white'
: tagColor.color,
border: `1px solid ${
selectedTag === tag
? tagColor.color
: tagColor.border
}`,
'&:hover': {
backgroundColor:
selectedTag === tag
? tagColor.color
: tagColor.bg,
transform: 'translateY(-1px)',
},
}}
/>
))}
</Stack>
{/* Filter status */}
<Fade in={hasActiveFilter}>
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
sx={{ mt: 1.5 }}
>
<Stack direction="row" spacing={1} alignItems="center">
<Typography variant="body2" color="text.secondary">
{totalResults} of {totalItems} question{totalItems !== 1 ? 's' : ''}
</Typography>
{selectedTag && (
<Chip
label={selectedTag}
size="small"
onDelete={() => setSelectedTag(null)}
sx={{
fontSize: 11,
height: 24,
backgroundColor: tagColor.bg,
color: tagColor.color,
fontWeight: 600,
'& .MuiChip-deleteIcon': {
color: tagColor.color,
'&:hover': {
color: tagColor.color,
},
},
}}
/>
)}
</Stack>
<Typography
variant="body2"
onClick={clearFilters}
sx={{
color: 'primary.main',
cursor: 'pointer',
fontWeight: 500,
'&:hover': { textDecoration: 'underline' },
}}
>
Clear all
</Typography>
</Stack>
</Fade>
</Container>
</Box>
{/* FAQ Content */}
<Container maxWidth="md" sx={{ py: 6 }}>
{filteredSections.length === 0 ? (
<Box sx={{ textAlign: 'center', py: 10 }}>
<Typography sx={{ fontSize: 56, mb: 2, opacity: 0.4 }}>π</Typography>
<Typography variant="h5" sx={{ mb: 1 }}>
No results found
</Typography>
<Typography color="text.secondary" sx={{ mb: 3 }}>
Try adjusting your search or filters
</Typography>
<Chip
label="Clear filters"
onClick={clearFilters}
sx={{
cursor: 'pointer',
fontWeight: 600,
}}
/>
</Box>
) : (
filteredSections.map((section) => (
<Box key={section.id} sx={{ mb: 6 }}>
{/* Section header */}
<Typography variant="h4" sx={{ mb: 3 }}>{section.title}</Typography>
{/* FAQ items */}
{section.items.map((item, index) => (
<Accordion
key={index}
sx={{
mb: 1.5,
transition: 'all 0.2s ease',
'&:hover': {
borderColor: 'rgba(0,0,0,0.15)',
},
}}
>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<Box>
<Typography fontWeight={600} sx={{ mb: 1 }}>
{item.question}
</Typography>
<Stack direction="row" spacing={0.5} flexWrap="wrap" useFlexGap>
{item.tags.map((tag) => (
<Chip
key={tag}
label={tag}
size="small"
onClick={(e) => {
e.stopPropagation();
handleTagClick(tag);
}}
sx={{
fontSize: 11,
height: 22,
cursor: 'pointer',
backgroundColor: tagColor.bg,
color: tagColor.color,
border: `1px solid ${
selectedTag === tag
? tagColor.color
: 'transparent'
}`,
fontWeight: 600,
transition: 'all 0.15s ease',
'&:hover': {
backgroundColor: tagColor.bg,
transform: 'scale(1.05)',
},
}}
/>
))}
</Stack>
</Box>
</AccordionSummary>
<AccordionDetails>
<Box
sx={{
'& pre': {
m: 0,
backgroundColor: 'rgba(0,0,0,0.04)',
border: '1px solid rgba(0,0,0,0.08)',
borderRadius: 2,
p: 2,
overflowX: 'auto',
},
'& code': {
fontFamily: 'monospace',
fontSize: 13,
lineHeight: 1.7,
},
'& code:not(pre code)': {
backgroundColor: 'rgba(0,0,0,0.06)',
px: 1,
py: 0.25,
borderRadius: 1,
display: 'inline-block',
},
'& ul': {
pl: 3,
mb: 1.5,
color: 'text.secondary',
},
'& li': {
mb: 0.5,
lineHeight: 1.7,
},
}}
>
<ReactMarkdown
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeHighlight]}
components={{
p: ({ children }) => (
<Typography variant="body2" color="text.secondary" sx={{ lineHeight: 1.7, mb: 1.5 }}>
{children}
</Typography>
),
pre: ({ children }) => <Box component="pre">{children}</Box>,
code: ({ inline, className, children, ...props }) =>
inline ? (
<Box component="code" {...props}>
{children}
</Box>
) : (
<Box component="code" className={className} {...props}>
{children}
</Box>
),
a: ({ children, ...props }) => (
<Box
component="a"
{...props}
sx={{ color: 'primary.main', fontWeight: 600, textDecoration: 'none' }}
target="_blank"
rel="noreferrer"
>
{children}
</Box>
),
ul: ({ children }) => <Box component="ul">{children}</Box>,
li: ({ children }) => <Box component="li">{children}</Box>,
}}
>
{item.answer}
</ReactMarkdown>
</Box>
</AccordionDetails>
</Accordion>
))}
</Box>
))
)}
</Container>
{/* Still have questions? - Discord CTA */}
<Box sx={{ py: 8 }}>
<Container maxWidth="md">
<Box
component="a"
href="https://discord.gg/2bAhWfXme9"
target="_blank"
rel="noopener noreferrer"
sx={{
display: 'flex',
flexDirection: { xs: 'column', sm: 'row' },
alignItems: { xs: 'flex-start', sm: 'center' },
justifyContent: 'space-between',
gap: 3,
p: { xs: 4, md: 5 },
borderRadius: 4,
background: '#0f0f1a',
border: '1px solid rgba(255,255,255,0.08)',
textDecoration: 'none',
transition: 'all 0.3s ease',
'&:hover': {
borderColor: 'rgba(255,255,255,0.2)',
},
}}
>
<Stack direction="row" spacing={3} alignItems="center">
<Box
component="img"
src="/assets/discord-logo.svg"
alt="Discord"
sx={{ width: 48, height: 48, opacity: 0.9 }}
/>
<Box>
<Typography variant="h5" sx={{ color: 'white', fontWeight: 600, mb: 0.5 }}>
Need more help?
</Typography>
<Typography sx={{ color: 'rgba(255,255,255,0.5)', fontSize: 14 }}>
Join our Discord to chat with 500+ makers and the Pollen team.
</Typography>
</Box>
</Stack>
<Typography
sx={{
color: 'rgba(255,255,255,0.6)',
fontSize: 14,
fontWeight: 500,
whiteSpace: 'nowrap',
}}
>
Join Discord β
</Typography>
</Box>
</Container>
</Box>
</Layout>
);
}
|